home *** CD-ROM | disk | FTP | other *** search
/ Chip: Internet / Chip Internet.iso / viewer / mathread / sample.ma < prev    next >
Text File  |  1994-05-01  |  94KB  |  4,572 lines

  1. (*^
  2.  
  3. ::[    frontEndVersion = "Microsoft Windows Mathematica Notebook Front End Version 2.2";
  4.     microsoftWindowsStandardFontEncoding;
  5.     fontset = title, "Arial", 22, L0, nohscroll, bold;
  6.     fontset = subtitle, "Times New Roman", 11, L0, nohscroll;
  7.     fontset = subsubtitle, "Arial", 11, L0, nohscroll;
  8.     fontset = section, "Arial", 17, L0, nohscroll, bold;
  9.     fontset = subsection, "Arial", 15, L0, nohscroll, bold, blackBox;
  10.     fontset = subsubsection, "Arial", 11, L0, nohscroll, bold, whiteBox;
  11.     fontset = text, "Times New Roman", 10, L0, nohscroll;
  12.     fontset = smalltext, "Times New Roman", 10, L0, nohscroll;
  13.     fontset = input, "Courier New", 10, L0, nowordwrap, bold, B65535;
  14.     fontset = output, "Courier New", 10, L0, nowordwrap, B65535;
  15.     fontset = message, "Times New Roman", 10, L0, nowordwrap, R65535;
  16.     fontset = print, "Times New Roman", 10, L0, nowordwrap;
  17.     fontset = info, "Times New Roman", 10, L0, nowordwrap;
  18.     fontset = postscript, "Times New Roman", 10, L0, nowordwrap;
  19.     fontset = name, "Times New Roman", 10, L0, nohscroll;
  20.     fontset = header, "Times New Roman", 11, L0;
  21.     fontset = footer, "Times New Roman", 11, L0;
  22.     fontset = help, "Times New Roman", 11, L0, nohscroll;
  23.     fontset = clipboard, "Times New Roman", 11, L0;
  24.     fontset = completions, "Times New Roman", 11, L0, nowordwrap;
  25.     fontset = graphics, "Times New Roman", 10, L0, nowordwrap, nohscroll;
  26.     fontset = special1, "Times New Roman", 9, L1, nowordwrap, bold;
  27.     fontset = special2, "Times New Roman", 12, L0, nowordwrap, blackBox;
  28.     fontset = special3, "Times New Roman", 12, L0, center, nowordwrap;
  29.     fontset = special4, "Times New Roman", 9, L0, right, nowordwrap, bold;
  30.     fontset = special5, "Times New Roman", 12, L0, center, nowordwrap;
  31.     fontset = leftheader, "Times New Roman", 12, L0, nohscroll;
  32.     fontset = leftfooter, "Times New Roman", 12, L0, center;
  33.     fontset = reserved1, "Times New Roman", 10, L0, nowordwrap, nohscroll;]
  34. :[font = title; inactive; preserveAspect; startGroup; nohscroll; ]
  35. A Sampling of Mathematica
  36.   
  37. :[font = text; inactive; preserveAspect; nohscroll; ]
  38. This file is a Mathematica notebook that gives some examples of what Mathematica can do.  For information on how to read this notebook, see the file READ1ST.MA.
  39.  
  40. This file is loosely based on the "Tour of Mathematica"  in Mathematica: A System for Doing Mathematics by Computer, Second Edition, by Stephen Wolfram.  This book was published by Addison-Wesley in 1991, and is available at most bookstores.  For information on how to obtain copies of Mathematica itself, see the section  "Buying Mathematica"  in the file READ1ST.MA.
  41. :[font = section; inactive; preserveAspect; startGroup; nohscroll; ]
  42. Numerical Calculations
  43. :[font = text; inactive; preserveAspect; nohscroll; ]
  44. You can use Mathematica as an enhanced scientific calculator.  Let's start with a simple example. 
  45. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  46. 45 + 78
  47. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  48. 123
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ;[o]
  137. 123
  138. :[font = text; inactive; preserveAspect; nohscroll; ]
  139. The first line here is what you type into Mathematica.  The second line is the result Mathematica gives. If you are reading this notebook on a color system, the input and output are blue, with the input in boldface.
  140. :[font = text; inactive; preserveAspect; nohscroll; ]
  141. Now let's try something more difficult.
  142. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  143. 3^100
  144. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  145. 515377520732011331036461129765621272702107522001
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233. ;[o]
  234. 515377520732011331036461129765621272702107522001
  235. :[font = text; inactive; preserveAspect; nohscroll; ]
  236. Unlike a calculator, Mathematica  gives an exact answer for 3 raised to the power 100.
  237. :[font = text; inactive; preserveAspect; nohscroll; ]
  238. Now let's really test out Mathematica.  Here is 3 raised to the power 1000.
  239. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  240. 3^1000
  241. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  242. 13220708194808066368904552597521443659654220327521481676649\
  243.  2036822682859734670489954077831385060806196390977769687258\
  244.  2355950954582100618911865342725257953674027620225198320803\
  245.  8780147742289648412743904001175886180411289478156230944380\
  246.  6156617305408667449050617812548034440554705439703889581746\
  247.  5368254916136220830268563778582290228416398307887896918556\
  248.  4040848989376093732421718463599386955167650189405881090604\
  249.  2608967143886410281435038564874716583201061436613217310276\
  250.  8902855220001
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338. ;[o]
  339. 13220708194808066368904552597521443659654220327521481676649\
  340.  
  341.  2036822682859734670489954077831385060806196390977769687258\
  342.  
  343.  2355950954582100618911865342725257953674027620225198320803\
  344.  
  345.  8780147742289648412743904001175886180411289478156230944380\
  346.  
  347.  6156617305408667449050617812548034440554705439703889581746\
  348.  
  349.  5368254916136220830268563778582290228416398307887896918556\
  350.  
  351.  4040848989376093732421718463599386955167650189405881090604\
  352.  
  353.  2608967143886410281435038564874716583201061436613217310276\
  354.  
  355.  8902855220001
  356. :[font = text; inactive; preserveAspect; nohscroll; ]
  357. This took about half a second on a 386-based MS-DOS machine.
  358. :[font = text; inactive; preserveAspect; nohscroll; ]
  359. Here's the result in the form you might get on a calculator.
  360. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  361. N[%]
  362. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  363. "1.32207"*10^"477"
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451. ;[o]
  452.           477
  453. 1.32207 10
  454. :[font = text; inactive; preserveAspect; nohscroll; ]
  455. Here is the value of pi to two hundred decimal places.
  456. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  457. N[Pi, 200]
  458. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  459. 3.141592653589793238462643383279502884197169399375105820974\
  460.  9445923078164062862089986280348253421170679821480865132823\
  461.  0664709384460955058223172535940812848111745028410270193852\
  462.  1105559644622948954930382
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550. ;[o]
  551. 3.141592653589793238462643383279502884197169399375105820974\
  552.  
  553.  9445923078164062862089986280348253421170679821480865132823\
  554.  
  555.  0664709384460955058223172535940812848111745028410270193852\
  556.  
  557.  1105559644622948954930382
  558. :[font = text; inactive; preserveAspect; nohscroll; ]
  559. Mathematica knows about a big collection of mathematical functions -- most of those you would find in any book of mathematical tables.
  560. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  561. BesselJ[5, 34.6]
  562. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  563. 0.0511826
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651. ;[o]
  652. 0.0511826
  653. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  654.  
  655. Log[4.5 + 2I] 
  656. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  657. 1.59421 + 0.418224*I
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745. ;[o]
  746. 1.59421 + 0.418224 I
  747. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  748.  
  749. Zeta[1/2 + 14.3 I]
  750. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  751. -0.0119878 + 0.132231*I
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839. ;[o]
  840. -0.0119878 + 0.132231 I
  841. :[font = text; inactive; preserveAspect; nohscroll; ]
  842.  
  843. Mathematica can do many kinds of exact computations with integers.  FactorInteger gives the factors of an integer.
  844. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  845. FactorInteger[70612139395722186]
  846. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  847. The Unformatted text for this cell was not generated.
  848. Use options in the Actions Settings dialog box to control
  849. when Unformatted text is generated.
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937. ;[o]
  938. {{2, 1}, {3, 2}, {43, 5}, {26684839, 1}}
  939. :[font = text; inactive; preserveAspect; nohscroll; ]
  940. You can also do all the standard numerical matrix computations with Mathematica.  This computes the inverse of a 2 by 2 matrix.
  941. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  942. Inverse[{{3.5, 7.2}, {-2.4, 6.4}}]
  943. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  944. The Unformatted text for this cell was not generated.
  945. Use options in the Actions Settings dialog box to control
  946. when Unformatted text is generated.
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034. ;[o]
  1035. {{0.16129, -0.181452}, {0.0604839, 0.0882056}}
  1036. :[font = text; inactive; preserveAspect; nohscroll; ]
  1037. This gives a numerical approximation to the eigenvalues of the matrix computed in the last example. 
  1038. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  1039. Eigenvalues[%]
  1040. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  1041. The Unformatted text for this cell was not generated.
  1042. Use options in the Actions Settings dialog box to control
  1043. when Unformatted text is generated.
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131. ;[o]
  1132. {0.124748 + 0.0981812 I, 0.124748 - 0.0981812 I}
  1133. :[font = text; inactive; preserveAspect; nohscroll; ]
  1134. Mathematica will also solve  linear programming problems. This returns a list containing the maximum value of the "objective function" and the point at which it is attained.
  1135. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  1136. ConstrainedMax[17 x -20 y + 18 z,
  1137.   {x - y + z < 10, x < 5, x + z > 20}, {x, y, z}]
  1138. :[font = output; inactive; formatted; output; preserveAspect; endGroup; endGroup; nowordwrap; ]
  1139. The Unformatted text for this cell was not generated.
  1140. Use options in the Actions Settings dialog box to control
  1141. when Unformatted text is generated.
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229. ;[o]
  1230. {160, {x -> 0, y -> 10, z -> 20}}
  1231. :[font = section; inactive; preserveAspect; startGroup; nohscroll; ]
  1232. Algebraic Calculations
  1233. :[font = text; inactive; preserveAspect; nohscroll; ]
  1234. One of the most important features of Mathematica is its ability to deal with mathematical formulas in algebraic form.
  1235. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  1236. (1 + x)^3
  1237. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  1238. (1 + x)^3
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326. ;[o]
  1327.        3
  1328. (1 + x)
  1329. :[font = text; inactive; preserveAspect; nohscroll; ]
  1330. This is what Mathematica does if you type in a simple algebraic expression.
  1331. You can expand the expression like this:
  1332. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  1333. Expand[%]
  1334. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  1335. 1 + 3*x + 3*x^2 + x^3
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423. ;[o]
  1424.              2    3
  1425. 1 + 3 x + 3 x  + x
  1426. :[font = text; inactive; preserveAspect; nohscroll; ]
  1427. Mathematica gives an explicit formula for the result.
  1428. You can factor this result to get back to what you started from.
  1429. % always stands for the last result that Mathematica gave you.
  1430. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  1431. Factor[%]
  1432. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  1433. (1 + x)^3
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.  
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521. ;[o]
  1522.        3
  1523. (1 + x)
  1524. :[font = text; inactive; preserveAspect; nohscroll; ]
  1525. Now let's try a more complicated example.
  1526. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  1527. (1 + 2x + 5y)^7
  1528. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  1529. (1 + 2*x + 5*y)^7
  1530.  
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.  
  1593.  
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617. ;[o]
  1618.                7
  1619. (1 + 2 x + 5 y)
  1620. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  1621. Expand[%]
  1622. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  1623. 1 + 14*x + 84*x^2 + 280*x^3 + 560*x^4 + 672*x^5 + 448*x^6 + 
  1624.    128*x^7 + 35*y + 420*x*y + 2100*x^2*y + 5600*x^3*y + 
  1625.    8400*x^4*y + 6720*x^5*y + 2240*x^6*y + 525*y^2 + 
  1626.    5250*x*y^2 + 21000*x^2*y^2 + 42000*x^3*y^2 + 42000*x^4*y^2 + 
  1627.    16800*x^5*y^2 + 4375*y^3 + 35000*x*y^3 + 105000*x^2*y^3 + 
  1628.    140000*x^3*y^3 + 70000*x^4*y^3 + 21875*y^4 + 131250*x*y^4 + 
  1629.    262500*x^2*y^4 + 175000*x^3*y^4 + 65625*y^5 + 262500*x*y^5 + 
  1630.    262500*x^2*y^5 + 109375*y^6 + 218750*x*y^6 + 78125*y^7
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718. ;[o]
  1719.                2        3        4        5        6
  1720. 1 + 14 x + 84 x  + 280 x  + 560 x  + 672 x  + 448 x  + 
  1721.  
  1722.         7                          2           3
  1723.    128 x  + 35 y + 420 x y + 2100 x  y + 5600 x  y + 
  1724.  
  1725.          4           5           6          2           2
  1726.    8400 x  y + 6720 x  y + 2240 x  y + 525 y  + 5250 x y  + 
  1727.  
  1728.           2  2          3  2          4  2          5  2
  1729.    21000 x  y  + 42000 x  y  + 42000 x  y  + 16800 x  y  + 
  1730.  
  1731.          3            3           2  3           3  3
  1732.    4375 y  + 35000 x y  + 105000 x  y  + 140000 x  y  + 
  1733.  
  1734.           4  3          4             4           2  4
  1735.    70000 x  y  + 21875 y  + 131250 x y  + 262500 x  y  + 
  1736.  
  1737.            3  4          5             5           2  5
  1738.    175000 x  y  + 65625 y  + 262500 x y  + 262500 x  y  + 
  1739.  
  1740.            6             6          7
  1741.    109375 y  + 218750 x y  + 78125 y
  1742. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  1743. Factor[%]
  1744. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  1745. (1 + 2*x + 5*y)^7
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799.  
  1800.  
  1801.  
  1802.  
  1803.  
  1804.  
  1805.  
  1806.  
  1807.  
  1808.  
  1809.  
  1810.  
  1811.  
  1812.  
  1813.  
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833. ;[o]
  1834.                7
  1835. (1 + 2 x + 5 y)
  1836. :[font = text; inactive; preserveAspect; nohscroll; ]
  1837. With the option setting Trig -> True Mathematica  will do algebraic operations using trigonometric identities.
  1838. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  1839. Expand[ Cos[x]^3 Sin[x]^2, Trig -> True]
  1840. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  1841. The Unformatted text for this cell was not generated.
  1842. Use options in the Actions Settings dialog box to control
  1843. when Unformatted text is generated.
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.  
  1861.  
  1862.  
  1863.  
  1864.  
  1865.  
  1866.  
  1867.  
  1868.  
  1869.  
  1870.  
  1871.  
  1872.  
  1873.  
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.  
  1931. ;[o]
  1932. Cos[x]   Cos[3 x]   Cos[5 x]
  1933. ------ - -------- - --------
  1934.   8         16         16
  1935. :[font = text; inactive; preserveAspect; nohscroll; ]
  1936. Mathematica also does linear algebra on symbolic matrices.
  1937. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  1938. Inverse[{{a, b}, {c, d}}]
  1939. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  1940. The Unformatted text for this cell was not generated.
  1941. Use options in the Actions Settings dialog box to control
  1942. when Unformatted text is generated.
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.  
  1991.  
  1992.  
  1993.  
  1994.  
  1995.  
  1996.  
  1997.  
  1998.  
  1999.  
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030. ;[o]
  2031.        d               b
  2032. {{------------, -(------------)}, 
  2033.   -(b c) + a d    -(b c) + a d
  2034.  
  2035.           c              a
  2036.   {-(------------), ------------}}
  2037.      -(b c) + a d   -(b c) + a d
  2038. :[font = subsection; inactive; preserveAspect; startGroup; nohscroll; ]
  2039. Calculus
  2040. :[font = text; inactive; preserveAspect; nohscroll; ]
  2041. You can use Mathematica to do calculus. Here's a simple integral.
  2042. :[font = input; preserveAspect; nowordwrap; ]
  2043. Integrate[x^n, x]
  2044. :[font = output; inactive; formatted; output; nowordwrap; ]
  2045. x^(1 + n)/(1 + n)
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072.  
  2073.  
  2074.  
  2075.  
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.  
  2120.  
  2121.  
  2122.  
  2123.  
  2124.  
  2125.  
  2126.  
  2127.  
  2128.  
  2129. ;[o]
  2130.  1 + n
  2131. x
  2132. ------
  2133. 1 + n
  2134. :[font = text; inactive; preserveAspect; nohscroll; ]
  2135. Here's a more complicated example.
  2136. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  2137. Integrate[x/(x^3-1), x]
  2138. :[font = output; inactive; formatted; output; endGroup; nowordwrap; ]
  2139. ArcTan[(1 + 2*x)/3^(1/2)]/3^(1/2) + Log[-1 + x]/3 - 
  2140.   Log[1 + x + x^2]/6
  2141.  
  2142.  
  2143.  
  2144.  
  2145.  
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  
  2151.  
  2152.  
  2153.  
  2154.  
  2155.  
  2156.  
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186.  
  2187.  
  2188.  
  2189.  
  2190.  
  2191. ;[o]
  2192.        1 + 2 x
  2193. ArcTan[-------]                              2
  2194.        Sqrt[3]    Log[-1 + x]   Log[1 + x + x ]
  2195. --------------- + ----------- - ---------------
  2196.     Sqrt[3]            3               6
  2197. :[font = text; inactive; preserveAspect; nohscroll; ]
  2198. Now let's try differentiating again.
  2199. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  2200. D[%, x]
  2201. :[font = output; inactive; formatted; output; endGroup; nowordwrap; ]
  2202. 1/(3*(-1 + x)) - (1 + 2*x)/(6*(1 + x + x^2)) + 
  2203.   2/(3*(1 + (1 + 2*x)^2/3))
  2204.  
  2205.  
  2206.  
  2207.  
  2208.  
  2209.  
  2210.  
  2211.  
  2212.  
  2213.  
  2214.  
  2215.  
  2216.  
  2217.  
  2218.  
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.  
  2253.  
  2254. ;[o]
  2255.     1           1 + 2 x               2
  2256. ---------- - -------------- + ------------------
  2257. 3 (-1 + x)               2                    2
  2258.              6 (1 + x + x )          (1 + 2 x)
  2259.                               3 (1 + ----------)
  2260.                                          3
  2261. :[font = text; inactive; preserveAspect; nohscroll; ]
  2262. This gives the expression in a different algebraic form. We can get back our original form using  Simplify.
  2263. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  2264. Simplify[%]
  2265. :[font = output; inactive; formatted; output; endGroup; nowordwrap; ]
  2266. x/(-1 + x^3)
  2267.  
  2268.  
  2269.  
  2270.  
  2271.  
  2272.  
  2273.  
  2274.  
  2275.  
  2276.  
  2277.  
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317. ;[o]
  2318.    x
  2319. -------
  2320.       3
  2321. -1 + x
  2322. :[font = text; inactive; preserveAspect; nohscroll; ]
  2323. Mathematica can also give exact solutions to many definite integrals.
  2324. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  2325. Integrate[ Sin[x]^10 Cos[x]^5/ x^10, {x, 0, Infinity}]
  2326. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  2327. The Unformatted text for this cell was not generated.
  2328. Use options in the Actions Settings dialog box to control
  2329. when Unformatted text is generated.
  2330.  
  2331.  
  2332.  
  2333.  
  2334.  
  2335.  
  2336.  
  2337.  
  2338.  
  2339.  
  2340.  
  2341.  
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384.  
  2385.  
  2386.  
  2387.  
  2388.  
  2389.  
  2390.  
  2391.  
  2392.  
  2393.  
  2394.  
  2395.  
  2396.  
  2397.  
  2398.  
  2399.  
  2400.  
  2401.  
  2402.  
  2403.  
  2404.  
  2405.  
  2406.  
  2407.  
  2408.  
  2409.  
  2410.  
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.  
  2417. ;[o]
  2418. 40221457 Pi
  2419. -----------
  2420.  297271296
  2421. :[font = text; inactive; preserveAspect; nohscroll; ]
  2422. Many integrals do not have a "closed form solution".  If you give Mathematica such a definite integral it will be returned unevaluated. You can still use N to get a numerical answer.
  2423. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  2424. Integrate[ Sin[ Sin[x]], {x, 0, Pi}]
  2425. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  2426. The Unformatted text for this cell was not generated.
  2427. Use options in the Actions Settings dialog box to control
  2428. when Unformatted text is generated.
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.  
  2450.  
  2451.  
  2452.  
  2453.  
  2454.  
  2455.  
  2456.  
  2457.  
  2458.  
  2459.  
  2460.  
  2461.  
  2462.  
  2463.  
  2464.  
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471.  
  2472.  
  2473.  
  2474.  
  2475.  
  2476.  
  2477.  
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516. ;[o]
  2517. Integrate[Sin[Sin[x]], {x, 0, Pi}]
  2518. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  2519. N[ % ]
  2520. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  2521. The Unformatted text for this cell was not generated.
  2522. Use options in the Actions Settings dialog box to control
  2523. when Unformatted text is generated.
  2524.  
  2525.  
  2526.  
  2527.  
  2528.  
  2529.  
  2530.  
  2531.  
  2532.  
  2533.  
  2534.  
  2535.  
  2536.  
  2537.  
  2538.  
  2539.  
  2540.  
  2541.  
  2542.  
  2543.  
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584.  
  2585.  
  2586.  
  2587.  
  2588.  
  2589.  
  2590.  
  2591.  
  2592.  
  2593.  
  2594.  
  2595.  
  2596.  
  2597.  
  2598.  
  2599.  
  2600.  
  2601.  
  2602.  
  2603.  
  2604.  
  2605.  
  2606.  
  2607.  
  2608.  
  2609.  
  2610.  
  2611. ;[o]
  2612. 1.78649
  2613. :[font = text; inactive; preserveAspect; nohscroll; ]
  2614. Mathematica  can also solve differential equations. Here is a pair of simultaneous differential equations. The solution you get involves two undetermined coefficients.
  2615. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  2616. DSolve[{x'[t] == -y[t], y'[t] == x[t]}, 
  2617.                                 {x[t], y[t]}, t]
  2618. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  2619. The Unformatted text for this cell was not generated.
  2620. Use options in the Actions Settings dialog box to control
  2621. when Unformatted text is generated.
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.  
  2648.  
  2649.  
  2650.  
  2651.  
  2652.  
  2653.  
  2654.  
  2655.  
  2656.  
  2657.  
  2658.  
  2659.  
  2660.  
  2661.  
  2662.  
  2663.  
  2664.  
  2665.  
  2666.  
  2667.  
  2668.  
  2669.  
  2670.  
  2671.  
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709. ;[o]
  2710. {{x[t] -> 
  2711.  
  2712.       -I t          2 I t                    2 I t
  2713.      E     (C[1] + E      C[1] - I C[2] + I E      C[2])
  2714.      ---------------------------------------------------, 
  2715.                               2
  2716.  
  2717.    y[t] -> 
  2718.  
  2719.       -I t              2 I t                2 I t
  2720.      E     (I C[1] - I E      C[1] + C[2] + E      C[2])
  2721.      ---------------------------------------------------}}
  2722.                               2
  2723. :[font = text; inactive; preserveAspect; nohscroll; ]
  2724. It is a mathematical fact that most differential equations do not have an explicit symbolic solution.  In these cases you can get a numerical approximation to the solution using NDSolve.  After the solution is computed it is plotted.
  2725. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  2726. NDSolve[{y''[x] + Sin[x]^2 y'[x] + y[x] == Cos[x]^2,
  2727.      y[0] == 1, y'[0] == 0}, y, {x, 0, 20}]
  2728. :[font = output; inactive; formatted; output; endGroup; nowordwrap; ]
  2729. {{y -> InterpolatingFunction[{0., 20.}, 
  2730.      {{0., 0., {1., 0}, {0}}, {0.00833391807887338, 0., 
  2731.        {0.999999995176227, -(5.788121337438936*10^-7)}, {0}}, 
  2732.       {0.01666783615774676, 0.00833391807887338, 
  2733.        {0.999999971059398, -(2.893816451849014*10^-6)}, {0}}, 
  2734.       {0.02964841775559651, 0.01666783615774676, 
  2735.        {0.999999884782133, -0.00001039946535062508, -0.0002891106551042133}, {0, 0}}, 
  2736.       {0.04262899935344625, 0.02964841775559651, 
  2737.        {0.99999963629125, -0.00002788709085687932, -0.0006736071636863751}, {0, 0}}, 
  2738.       {0.05560958095129599, 0.04262899935344625, 
  2739.        {0.999999067729387, -0.00005971481791480953, -0.001225974615159098}, {0, 0}}, 
  2740.       {0.0947110814028622, 0.05560958095129599, 
  2741.        {0.999992990405501, -0.0002832548310731072, -0.004090675192305029, 
  2742.         -0.02100886031499209}, {0, 0, 0}}, 
  2743.       {0.1338125818544285, 0.0947110814028622, 
  2744.        {0.999972842235183, -0.000795404113675191, -0.00839422924622937, 
  2745.         -0.03146097510686268}, {0, 0, 0}}, 
  2746.       {0.1729140823059947, 0.1338125818544285, 
  2747.        {0.999925180045169, -0.001709448541521507, -0.01425766259084529, 
  2748.         -0.04381014228844964}, {0, 0, 0}}, 
  2749.       {0.212015582757561, 0.1729140823059947, 
  2750.        {0.999832110961939, -0.003136424242784032, -0.02152655676290292, 
  2751.         -0.05591406698606363}, {0, 0, 0}}, 
  2752.       {0.2662168117990417, 0.212015582757561, 
  2753.        {0.999586307461538, -0.006159345634333782, -0.03447384405606041, 
  2754.         -0.0894067235086752, -0.1159353865755639}, {0, 0, 0, 0}}, 
  2755.       {0.3204180408405225, 0.2662168117990417, 
  2756.        {0.999138563793254, -0.01062961626936584, -0.0488804933614728, 
  2757.         -0.0999515751977062, -0.0822864492355502}, {0, 0, 0, 0}}, 
  2758.       {0.3746192698820033, 0.3204180408405225, 
  2759.        {0.998403967137245, -0.01677476344024842, -0.06511317173449482, 
  2760.         -0.1079277670269778, -0.05953808385419444}, {0, 0, 0, 0}}, 
  2761.       {0.4288204989234841, 0.3746192698820033, 
  2762.        {0.997286567111431, -0.02478296556198349, -0.0830466014765607, 
  2763.         -0.1163712107513933, -0.04924148718741053}, {0, 0, 0, 0}}, 
  2764.       {0.4830217279649649, 0.4288204989234841, 
  2765.        {0.995681303650757, -0.03479661173893778, -0.1020625494570019, 
  2766.         -0.1218515403628397, -0.03725959355237575}, {0, 0, 0, 0}}, 
  2767.       {0.5613173138914811, 0.4830217279649649, 
  2768.        {0.992274409291921, -0.05297494561351174, -0.1304064567167675, 
  2769.         -0.1222533212210714, 0.003468013152023301, 0.06814178090460001}, 
  2770.        {0, 0, 0, 0, 0}}, {0.6396128998179974, 0.5613173138914811, 
  2771.        {0.987269932222075, -0.075587964359899, -0.1581841708546187, 
  2772.         -0.1141090179013643, 0.03802885125642485, 0.07619826041218505}, {0, 0, 0, 0, 0}}\
  2773.        , {0.7179084857445135, 0.6396128998179974, 
  2774.        {0.980326632358465, -0.1024529530008248, -0.1843338202409464, 
  2775.         -0.1041523989994473, 0.04972845417453575, 0.05767324744231299}, {0, 0, 0, 0, 0}}\
  2776.        , {0.7962040716710297, 0.7179084857445135, 
  2777.        {0.97112656801724, -0.1331452929673846, -0.2069337614952762, 
  2778.         -0.0864840851602007, 0.06836174221683651, 0.05364286395141679}, {0, 0, 0, 0, 0}}\
  2779.        , {0.874499657597546, 0.7962040716710297, 
  2780.        {0.95939387213881, -0.1670233508920787, -0.2248069606885963, 
  2781.         -0.0637596061847227, 0.0839601600940049, 0.04812369770144293}, {0, 0, 0, 0, 0}}, 
  2782.       {0.952795243524062, 0.874499657597546, 
  2783.        {0.944910131095088, -0.2032699807621419, -0.237016271338782, 
  2784.         -0.03780571647612316, 0.0937923721791947, 0.03892046781240272}, {0, 0, 0, 0, 0}}\
  2785.        , {1.039724469825587, 0.952795243524062, 
  2786.        {0.92542768700412, -0.2451467267481447, -0.2432953081803271, 
  2787.         -0.00824729181249641, 0.0897846117528778, -0.001673254924233756, 
  2788.         -0.03900354228553359}, {0, 0, 0, 0, 0, 0}}, 
  2789.       {1.126653696127112, 1.039724469825587, 
  2790.        {0.902277860188137, -0.2874188841542655, -0.2416891819319895, 
  2791.         0.02063608418904903, 0.07910389882806989, -0.03100133325192045, 
  2792.         -0.04474562836492286}, {0, 0, 0, 0, 0, 0}}, 
  2793.       {1.213582922428637, 1.126653696127112, 
  2794.        {0.875485580139576, -0.3287280514535277, -0.2323712829100833, 
  2795.         0.04893730798569679, 0.0727017226171048, -0.03461662359913409, 
  2796.         -0.03214091300128465}, {0, 0, 0, 0, 0, 0}}, 
  2797.       {1.300512148730162, 1.213582922428637, 
  2798.        {0.845190514400944, -0.3678083556688001, -0.2161762060128813, 
  2799.         0.07364398094894601, 0.06204749522273448, -0.03833147746569672, 
  2800.         -0.02380139942507645}, {0, 0, 0, 0, 0, 0}}, 
  2801.       {1.387441375031688, 1.300512148730162, 
  2802.        {0.811635967165259, -0.403550383021133, -0.194152109096246, 0.0937578479719871, 
  2803.         0.04838696543453835, -0.04149193254483483, -0.01788741326513169}, 
  2804.        {0, 0, 0, 0, 0, 0}}, {1.474370601333213, 1.387441375031688, 
  2805.        {0.7751533548851127, -0.4350400348107747, -0.1674659123660279, 
  2806.         0.1092862811251535, 0.03508465303807659, -0.03984380825337941, 
  2807.         -0.01087164325150214}, {0, 0, 0, 0, 0, 0}}, 
  2808.       {1.561299827634738, 1.474370601333213, 
  2809.        {0.7361445508530884, -0.4615699439161367, -0.1372853292990113, 
  2810.         0.1206015647771803, 0.02393137346065979, -0.03350120050537078, 
  2811.         -0.003194268169120814}, {0, 0, 0, 0, 0, 0}}, 
  2812.       {1.681304309960248, 1.561299827634738, 
  2813.        {0.6789915111106743, -0.4891301489640757, -0.0919228965339709, 
  2814.         0.1292768679229947, 0.00815176057533371, -0.02990506007751192, 
  2815.         -0.0004646944704896713}, {0, 0, 0, 0, 0, 0}}, 
  2816.       {1.801308792285758, 1.681304309960248, 
  2817.        {0.6191991919062243, -0.5054577459715523, -0.04401311226784704, 
  2818.         0.1342605207357654, 0.002841551456797926, -0.0152591784453301, 
  2819.         0.006470451181344034}, {0, 0, 0, 0, 0, 0}}, 
  2820.       {1.921313274611268, 1.801308792285758, 
  2821.        {0.5581427049731596, -0.5101582305930661, 0.004874149536455347, 
  2822.         0.136158427462008, 0.001004286771591462, -0.003634819171370164, 
  2823.         0.0096950809212789}, {0, 0, 0, 0, 0, 0}}, 
  2824.       {2.041317756936777, 1.921313274611268, 
  2825.        {0.4972273696587786, -0.5030939313345982, 0.05401710829484653, 
  2826.         0.1367713608599165, 0.001671272833691763, 0.004232531538534417, 
  2827.         0.01010554323177437}, {0, 0, 0, 0, 0, 0}}, 
  2828.       {2.161322239262287, 2.041317756936777, 
  2829.        {0.4378672196864744, -0.4842377162854067, 0.1031746489495831, 
  2830.         0.1370225274521481, 0.002828959484448976, 0.00731496575524099, 
  2831.         0.0081640283969828}, {0, 0, 0, 0, 0, 0}}, 
  2832.       {2.281326721587797, 2.161322239262287, 
  2833.        {0.3814775644132748, -0.4535868073565616, 0.1523290209110124, 
  2834.         0.1371074550524677, 0.002822610938436043, 0.005947610746796621, 
  2835.         0.004809674516537869}, {0, 0, 0, 0, 0, 0}}, 
  2836.       {2.401331203913307, 2.281326721587797, 
  2837.        {0.3294736915410828, -0.4111478502197694, 0.2013732951984304, 
  2838.         0.1363926555225938, 0.0001288989039143415, 0.000821168844185928, 
  2839.         0.000833185592853021}, {0, 0, 0, 0, 0, 0}}, 
  2840.       {2.542772658376751, 2.401331203913307, 
  2841.        {0.2757297584641557, -0.3461058227991112, 0.2583852300977294, 
  2842.         0.1331684232865173, -0.006068693949784442, -0.005486938130793508, 
  2843.         -0.001922249271282172}, {0, 0, 0, 0, 0, 0}}, 
  2844.       {2.684214112840195, 2.542772658376751, 
  2845.        {0.2323095323439747, -0.2653100131048529, 0.3123095236797067, 
  2846.         0.1219987507440542, -0.02360618566761217, -0.02017399776343716, 
  2847.         -0.007050301598869567}, {0, 0, 0, 0, 0, 0}}, 
  2848.       {2.825655567303638, 2.684214112840195, 
  2849.        {0.2013587732886943, -0.1701107476185192, 0.3593398802765652, 
  2850.         0.0992154729919184, -0.04999050091597547, -0.03613991566078571, 
  2851.         -0.01097131473698204}, {0, 0, 0, 0, 0, 0}}, 
  2852.       {2.94090773577456, 2.825655567303638, 
  2853.        {0.1866660302339092, -0.083734181441487, 0.3884126626834722, 
  2854.         0.0678735728010783, -0.080769600276177, -0.05324090822123911, 
  2855.         -0.01555748329058616}, {0, 0, 0, 0, 0, 0}}, 
  2856.       {3.056159904245482, 2.94090773577456, 
  2857.        {0.1822656373066757, 0.00801851053373228, 0.405187738776143, 
  2858.         0.02594347704203732, -0.1075344137851808, -0.0554054500027122, 
  2859.         -0.01141503998383918}, {0, 0, 0, 0, 0, 0}}, 
  2860.       {3.171412072716403, 3.056159904245482, 
  2861.        {0.1885930595441774, 0.1017818001707295, 0.4051123188938136, 
  2862.         -0.02942474200101653, -0.1370287052395822, -0.05753197974138712, 
  2863.         -0.00863508798536618}, {0, 0, 0, 0, 0, 0}}, 
  2864.       {3.286664241187325, 3.171412072716403, 
  2865.        {0.2056400155928512, 0.1932474756802978, 0.3845899052166693, 
  2866.         -0.0934917893702448, -0.1546675134905729, -0.04239133923068873, 
  2867.         0.001541590241313823}, {0, 0, 0, 0, 0, 0}}, 
  2868.       {3.401916409658246, 3.286664241187325, 
  2869.        {0.2328563793926067, 0.2773691339306689, 0.34109495254209, -0.1618186780821784, 
  2870.         -0.1577454988805315, -0.01554859053929419, 0.01396686572595587}, 
  2871.        {0, 0, 0, 0, 0, 0}}, {3.517168578129168, 3.401916409658246, 
  2872.        {0.2690871506570089, 0.3487885752586647, 0.2745700882745694, 
  2873.         -0.225737366462248, -0.1382546697176523, 0.02555136177514839, 
  2874.         0.02912285096039894}, {0, 0, 0, 0, 0, 0}}, 
  2875.       {3.632420746600089, 3.517168578129168, 
  2876.        {0.3125706462748742, 0.4024492684526743, 0.187822578121628, 
  2877.         -0.2763861795476287, -0.0960889238707762, 0.07219643251032651, 
  2878.         0.04189978114526334}, {0, 0, 0, 0, 0, 0}}, 
  2879.       {3.725109407819565, 3.632420746600089, 
  2880.        {0.3512620135363042, 0.4299290818887456, 0.107412227022088, 
  2881.         -0.3005640459910517, -0.04323714316680158, 0.1168117841171798, 
  2882.         0.05467465302278006}, {0, 0, 0, 0, 0, 0}}, 
  2883.       {3.81779806903904, 3.725109407819565, 
  2884.        {0.3917904952968756, 0.4419309392488788, 0.02172352127582405, 
  2885.         -0.3108504026919281, 0.002164157431342671, 0.1231829684233062, 
  2886.         0.04026851715676733}, {0, 0, 0, 0, 0, 0}}, 
  2887.       {3.910486730258516, 3.81779806903904, 
  2888.        {0.4326918620034929, 0.4379758288712375, -0.06387740657290522, 
  2889.         -0.3006019532853317, 0.05900637767156045, 0.1372987541084725, 
  2890.         0.03530637119819712}, {0, 0, 0, 0, 0, 0}}, 
  2891.       {4.003175391477992, 3.910486730258516, 
  2892.        {0.4725011176105553, 0.4185189358824858, -0.1446202564348373, 
  2893.         -0.274220686748258, 0.1031795907547836, 0.1203683382443131, 0.0133898599584594}\
  2894.         , {0, 0, 0, 0, 0, 0}}, {4.095864052697468, 4.003175391477992, 
  2895.        {0.5098377243376872, 0.3849182165467272, -0.2157792131249126, 
  2896.         -0.2324963289827529, 0.1390336054007866, 0.0948309615633768, 
  2897.         -0.006379971532477048}, {0, 0, 0, 0, 0, 0}}, 
  2898.       {4.188552713916943, 4.095864052697468, 
  2899.        {0.5434841394689352, 0.3393013289193458, -0.2737656374313115, 
  2900.         -0.1802979492997102, 0.1595565707246038, 0.05685467930942619, 
  2901.         -0.02701546703682218}, {0, 0, 0, 0, 0, 0}}, 
  2902.       {4.281241375136419, 4.188552713916943, 
  2903.        {0.572447785430196, 0.2843558947274208, -0.3161971998514954, 
  2904.         -0.122264942308157, 0.1653743813296863, 0.01586170221652741, 
  2905.         -0.04258060492248024}, {0, 0, 0, 0, 0, 0}}, 
  2906.       {4.373930036355894, 4.281241375136419, 
  2907.        {0.5960014850798974, 0.2230777241867219, -0.3421089612789228, 
  2908.         -0.06332520992789894, 0.1578898632590121, -0.02205728915998342, 
  2909.         -0.05111488373171465}, {0, 0, 0, 0, 0, 0}}, 
  2910.       {4.46661869757537, 4.373930036355894, 
  2911.        {0.6137001067015681, 0.1585165653838159, -0.3518415037839711, 
  2912.         -0.007675939696713177, 0.140530006757211, -0.05132237528013174, 
  2913.         -0.05161744147012517}, {0, 0, 0, 0, 0, 0}}, 
  2914.       {4.559307358794845, 4.46661869757537, 
  2915.        {0.6253749241516738, 0.0935542213533712, -0.3467991533934443, 
  2916.         0.04154966229973188, 0.1172911318219722, -0.06906508234422367, 
  2917.         -0.04504621805982206}, {0, 0, 0, 0, 0, 0}}, 
  2918.       {4.651996020014321, 4.559307358794845, 
  2919.        {0.6311098831149206, 0.03073885364522069, -0.3291073644761135, 
  2920.         0.0824724807913901, 0.091973186860954, -0.07508555495239954, 
  2921.         -0.03363935159643217}, {0, 0, 0, 0, 0, 0}}, 
  2922.       {4.744684681233796, 4.651996020014321, 
  2923.        {0.631205564143831, -0.02781417648856333, -0.3012492144753016, 
  2924.         0.1144260245090412, 0.06763696782928247, -0.07125622832004082, 
  2925.         -0.02013101979784824}, {0, 0, 0, 0, 0, 0}}, 
  2926.       {4.837373342453272, 4.744684681233796, 
  2927.        {0.6261369840401928, -0.0804574507723391, -0.2657459421964767, 
  2928.         0.1377174863924611, 0.04625548308830262, -0.060768549908873, 
  2929.         -0.007134594890492969}, {0, 0, 0, 0, 0, 0}}, 
  2930.       {4.934711057758853, 4.837373342453272, 
  2931.        {0.6159201087085061, -0.1280753363357008, -0.222780680204344, 
  2932.         0.1537211920713317, 0.026969734226607, -0.04854088562463728, 
  2933.         0.002222549648551576}, {0, 0, 0, 0, 0, 0}}, 
  2934.       {5.032048773064435, 4.934711057758853, 
  2935.        {0.6014883015350931, -0.1669435303944454, -0.1761636801681448, 
  2936.         0.1632626749556451, 0.01413699514179585, -0.03204915206006134, 
  2937.         0.01089436593911474}, {0, 0, 0, 0, 0, 0}}, 
  2938.       {5.129386488370016, 5.032048773064435, 
  2939.        {0.5837216041322559, -0.1965367995936811, -0.1277013131487805, 
  2940.         0.1674204074601373, 0.00442178411905284, -0.01939997452893074, 
  2941.         0.01448243579015764}, {0, 0, 0, 0, 0, 0}}, 
  2942.       {5.226724203675598, 5.129386488370016, 
  2943.        {0.5635360668422292, -0.2166241743157104, -0.07865201513789311, 
  2944.         0.1679556785833564, -0.001842232210436084, -0.00931816238387862, 
  2945.         0.01540915712474707}, {0, 0, 0, 0, 0, 0}}, 
  2946.       {5.324061918981179, 5.226724203675598, 
  2947.        {0.5418594791433887, -0.2271828520030699, -0.02990388016056814, 
  2948.         0.1659242665318757, -0.006270015176177259, -0.003339483833459909, 
  2949.         0.01368510554940685}, {0, 0, 0, 0, 0, 0}}, 
  2950.       {5.42139963428676, 5.324061918981179, 
  2951.        {0.5196144746179701, -0.2283325924621065, 0.01793903091440181, 
  2952.         0.162067279271888, -0.0098851433350467, -0.001053910393950397, 
  2953.         0.01042789602096576}, {0, 0, 0, 0, 0, 0}}, 
  2954.       {5.518737349592342, 5.42139963428676, 
  2955.        {0.4977068276524621, -0.2202955529067307, 0.06440879960013125, 
  2956.         0.1566328278011604, -0.0138008639463196, -0.002048552973445705, 
  2957.         0.006384237871031489}, {0, 0, 0, 0, 0, 0}}, 
  2958.       {5.6497384662035, 5.518737349592342, 
  2959.        {0.4702987123609765, -0.1955400310358288, 0.1240203697432546, 
  2960.         0.1472188891207061, -0.01807952335372325, -0.001966538756102868, 
  2961.         0.00429093954687942}, {0, 0, 0, 0, 0, 0}}, 
  2962.       {5.780739582814659, 5.6497384662035, 
  2963.        {0.4471299527707536, -0.1557874344568862, 0.1786320840830031, 
  2964.         0.1319216672869627, -0.03054559453713223, -0.01183041202887594, 
  2965.         -0.001322490342922966}, {0, 0, 0, 0, 0, 0}}, 
  2966.       {5.911740699425817, 5.780739582814659, 
  2967.        {0.430068659144168, -0.1026166040500049, 0.2259225306326176, 
  2968.         0.1090694942456648, -0.04892237223706918, -0.02395631349035135, 
  2969.         -0.006024068245668866}, {0, 0, 0, 0, 0, 0}}, 
  2970.       {6.042741816036976, 5.911740699425817, 
  2971.        {0.4207288145878859, -0.0383763800208355, 0.2623942051336694, 
  2972.         0.07574889255611462, -0.0733084075943239, -0.0363899621963443, 
  2973.         -0.00928896437989113}, {0, 0, 0, 0, 0, 0}}, 
  2974.       {6.148769256206156, 6.042741816036976, 
  2975.        {0.4196897500730867, 0.01943482123721286, 0.2809613885934563, 
  2976.         0.03966871718650941, -0.0959756636264141, -0.04470825276491381, 
  2977.         -0.01055120569454534}, {0, 0, 0, 0, 0, 0}}, 
  2978.       {6.254796696375336, 6.148769256206156, 
  2979.        {0.4249451047684489, 0.07991307776828176, 0.2870681658273384, 
  2980.         -0.003651896875224109, -0.1143450955504997, -0.04195180205020696, 
  2981.         -0.005589830348615508}, {0, 0, 0, 0, 0, 0}}, 
  2982.       {6.360824136544517, 6.254796696375336, 
  2983.        {0.4366274857621696, 0.1401379551064204, 0.2781781535944063, 
  2984.         -0.05444083112141437, -0.130699368410524, -0.03641559878130813, 
  2985.         -0.000825730460126903}, {0, 0, 0, 0, 0, 0}}, 
  2986.       {6.466851576713697, 6.360824136544517, 
  2987.        {0.4545348155049683, 0.1967456552446105, 0.2526968341553538, 
  2988.         -0.1083739883258813, -0.1351493159885628, -0.01697551496744537, 
  2989.         0.00963559933218772}, {0, 0, 0, 0, 0, 0}}, 
  2990.       {6.572879016882877, 6.466851576713697, 
  2991.        {0.4780931121909542, 0.2461236474617443, 0.2100197093572238, 
  2992.         -0.161718374606281, -0.1274191023921288, 0.00926640800870051, 
  2993.         0.02017380180858237}, {0, 0, 0, 0, 0, 0}}, 
  2994.       {6.678906457052057, 6.572879016882877, 
  2995.        {0.5063450945109464, 0.284714740779341, 0.1513125419111771, 
  2996.         -0.2081509114854203, -0.10284534810883, 0.04374984637560226, 
  2997.         0.03151760475184295}, {0, 0, 0, 0, 0, 0}}, 
  2998.       {6.784933897221238, 6.678906457052057, 
  2999.        {0.5379757930841826, 0.3093945084591084, 0.07953745376701109, 
  3000.         -0.2420209273985199, -0.06343949399562393, 0.0783106227462882, 
  3001.         0.03912066310212652}, {0, 0, 0, 0, 0, 0}}, 
  3002.       {6.890961337390418, 6.784933897221238, 
  3003.        {0.5713794688857158, 0.3178661444857127, -0.0005288976495891239, 
  3004.         -0.2582209592123561, -0.01273748823502487, 0.1066461745027587, 
  3005.         0.04092751672434397}, {0, 0, 0, 0, 0, 0}}, 
  3006.       {6.996988777559598, 6.890961337390418, 
  3007.        {0.6047659964384576, 0.3089937459954282, -0.0828378377096369, 
  3008.         -0.2540816899925198, 0.04155322850368667, 0.1205023264908303, 
  3009.         0.03454526585656345}, {0, 0, 0, 0, 0, 0}}, 
  3010.       {7.103016217728779, 6.996988777559598, 
  3011.        {0.6362958459121706, 0.2829988295858012, -0.1608247748025501, 
  3012.         -0.2296920370993327, 0.0909423128188934, 0.1154239346981472, 
  3013.         0.02036923515591294}, {0, 0, 0, 0, 0, 0}}, 
  3014.       {7.209043657897959, 7.103016217728779, 
  3015.        {0.6642262249859475, 0.2414684562835535, -0.2283657430009311, 
  3016.         -0.1881349902886567, 0.1275788739519631, 0.091114829316101, 
  3017.         0.000842166139473678}, {0, 0, 0, 0, 0, 0}}, 
  3018.       {7.315071098067139, 7.209043657897959, 
  3019.        {0.6870474825296047, 0.1871666951901771, -0.2806327955244892, 
  3020.         -0.1346980858158454, 0.146806830012917, 0.05274733794014212, 
  3021.         -0.01954209981285231}, {0, 0, 0, 0, 0, 0}}, 
  3022.       {7.42109853823632, 7.315071098067139, 
  3023.        {0.7035906161958929, 0.1236879959525679, -0.3146862203334908, 
  3024.         -0.07576121249400114, 0.1479876662046755, 0.00904198600711933, 
  3025.         -0.03592850725343673}, {0, 0, 0, 0, 0, 0}}, 
  3026.       {7.508548200721756, 7.42109853823632, 
  3027.        {0.7119569421054281, 0.06725267492449426, -0.3284763887010949, 
  3028.         -0.02837686379826418, 0.1329404504195173, -0.0338305316853618, 
  3029.         -0.05118865299027373}, {0, 0, 0, 0, 0, 0}}, 
  3030.       {7.595997863207193, 7.508548200721756, 
  3031.        {0.715315949780163, 0.00953666075155094, -0.3295549730850125, 
  3032.         0.01821714034283916, 0.1231736125715181, -0.04309656932000198, 
  3033.         -0.04001235362758417}, {0, 0, 0, 0, 0, 0}}, 
  3034.       {7.68344752569263, 7.595997863207193, 
  3035.        {0.7136487705836433, -0.04737048172691336, -0.319470907992834, 
  3036.         0.05732411012639528, 0.0992602176059251, -0.06486523951445801, 
  3037.         -0.04050423614006127}, {0, 0, 0, 0, 0, 0}}, 
  3038.       {7.770897188178066, 7.68344752569263, 
  3039.        {0.7071083616052322, -0.1016343815044814, -0.2996825389057643, 
  3040.         0.0907012234456363, 0.07972445790005689, -0.06436764782348005, 
  3041.         -0.0266867110056111}, {0, 0, 0, 0, 0, 0}}, 
  3042.       {7.858346850663503, 7.770897188178066, 
  3043.        {0.6959947989741137, -0.1517340682151469, -0.2721598930398282, 
  3044.         0.1165834887925766, 0.05912674708073994, -0.06124448946776559, 
  3045.         -0.01580704156003532}, {0, 0, 0, 0, 0, 0}}, 
  3046.       {7.945796513148939, 7.858346850663503, 
  3047.        {0.6807265961078732, -0.1964816008899929, -0.2387811298958788, 
  3048.         0.1355237382167871, 0.04074956752321094, -0.05304738379620384, 
  3049.         -0.005330520363742534}, {0, 0, 0, 0, 0, 0}}, 
  3050.       {8.03324617563438, 7.945796513148939, 
  3051.        {0.6618120210865529, -0.235007146223984, -0.2012652124514683, 
  3052.         0.1484735118659785, 0.02609187562192261, -0.04107493733669246, 
  3053.         0.004052248648632112}, {0, 0, 0, 0, 0, 0}}, 
  3054.       {8.13281647858731, 8.03324617563438, 
  3055.        {0.6365666256323173, -0.2705578217930717, -0.1554143998677767, 
  3056.         0.1567841171431649, 0.01168305235896042, -0.03094405183690827, 
  3057.         0.00835405769857628}, {0, 0, 0, 0, 0, 0}}, 
  3058.       {8.23238678154024, 8.13281647858731, 
  3059.        {0.6082431419559099, -0.2967750337269512, -0.1077494564462849, 
  3060.         0.1608984816346291, 0.004247223586764598, -0.01641473154122497, 
  3061.         0.01367605056704525}, {0, 0, 0, 0, 0, 0}}, 
  3062.       {8.33195708449317, 8.23238678154024, 
  3063.        {0.577784120914065, -0.3134339055402551, -0.05953811368154387, 
  3064.         0.1614440284861633, -0.001289667344705027, -0.007391672230884399, 
  3065.         0.01415181062807798}, {0, 0, 0, 0, 0, 0}}, 
  3066.       {8.4315273874461, 8.33195708449317, 
  3067.        {0.5461440691897473, -0.3205041965092996, -0.01153044746058099, 
  3068.         0.1599897846312538, -0.004251321802033386, -0.000902600522639419, 
  3069.         0.0130551378569107}, {0, 0, 0, 0, 0, 0}}, 
  3070.       {8.53109769039903, 8.4315273874461, 
  3071.        {0.5142738766780949, -0.3180795927526536, 0.03577363066773096, 
  3072.         0.1571229559804813, -0.006577584441561852, 0.001482907273865936, 
  3073.         0.01003442662074849}, {0, 0, 0, 0, 0, 0}}, 
  3074.       {8.63066799335196, 8.53109769039903, 
  3075.        {0.4831108459882951, -0.3063344544102378, 0.0820313244162032, 
  3076.         0.1531175103029168, -0.00927229611410421, 0.000494411643843004, 
  3077.         0.006138083582243782}, {0, 0, 0, 0, 0, 0}}, 
  3078.       {8.73023829630489, 8.63066799335196, 
  3079.        {0.4535716023768427, -0.2855097741744401, 0.1268966232463498, 
  3080.         0.1477532308525086, -0.01335343899256266, -0.00326828169498264, 
  3081.         0.001992649446489698}, {0, 0, 0, 0, 0, 0}}, 
  3082.       {8.86853706166008, 8.73023829630489, 
  3083.        {0.4168957664706038, -0.2421465920259155, 0.186033920052283, 
  3084.         0.1376415504533291, -0.01955900396889146, -0.006226046456233117, 
  3085.         0.0001402787238175492}, {0, 0, 0, 0, 0, 0}}, 
  3086.       {9.00683582701527, 8.86853706166008, 
  3087.        {0.3873133089628441, -0.1832009589109362, 0.2391604658504614, 
  3088.         0.1194158487607151, -0.03657179027041812, -0.01912265748898118, 
  3089.         -0.005087137300382149}, {0, 0, 0, 0, 0, 0}}, 
  3090.       {9.14513459237046, 9.00683582701527, 
  3091.        {0.3668459725895333, -0.1107675977632014, 0.2827664641505057, 
  3092.         0.0904741307504649, -0.06105497627860227, -0.03334834968294583, 
  3093.         -0.00910598226711434}, {0, 0, 0, 0, 0, 0}}, 
  3094.       {9.25551848210048, 9.14513459237046, 
  3095.        {0.358174780486633, -0.04543522767724458, 0.3073147681705959, 
  3096.         0.05682751593190138, -0.0872347772763798, -0.04719359215798584, 
  3097.         -0.01303888308333311}, {0, 0, 0, 0, 0, 0}}, 
  3098.       {9.36590237183051, 9.25551848210048, 
  3099.        {0.3569689170579342, 0.0240437088904494, 0.319734347355598, 0.0153949424826356, 
  3100.         -0.10748769315549, -0.04537092073303919, -0.007775249028397182}, 
  3101.        {0, 0, 0, 0, 0, 0}}, {9.47628626156054, 9.36590237183051, 
  3102.        {0.3635240167106242, 0.0946146964924285, 0.3166975492438402, 
  3103.         -0.03606205041814986, -0.1294834656160662, -0.04480815677117695, 
  3104.         -0.004900263595449484}, {0, 0, 0, 0, 0, 0}}, 
  3105.       {9.58667015129057, 9.47628626156054, 
  3106.        {0.3777627204242523, 0.1626036266853592, 0.2959259363536388, 
  3107.         -0.0926247989354754, -0.1391946025040434, -0.02769901981809202, 
  3108.         0.005344084531133543}, {0, 0, 0, 0, 0, 0}}, 
  3109.       {9.6970540410206, 9.58667015129057, 
  3110.        {0.3991762429051354, 0.2239075678530466, 0.2560371404406648, 
  3111.         -0.1507645016710531, -0.1366905838708684, -0.002654030084916582, 
  3112.         0.01616771748066033}, {0, 0, 0, 0, 0, 0}}, 
  3113.       {9.80743793075063, 9.6970540410206, 
  3114.        {0.4267941325099065, 0.2743358773210897, 0.1976733538375297, 
  3115.         -0.2032950375338783, -0.1154060623257763, 0.03337009626838069, 
  3116.         0.02890920697890405}, {0, 0, 0, 0, 0, 0}}, 
  3117.       {9.91782182048066, 9.80743793075063, 
  3118.        {0.4591991417689332, 0.3100650075752322, 0.123603905921198, -0.243575402577297, 
  3119.         -0.07673555042606388, 0.07166175197415298, 0.03854476735548534}, 
  3120.        {0, 0, 0, 0, 0, 0}}, {10.02820571021069, 9.91782182048066, 
  3121.        {0.4945953807195917, 0.3281412695830418, 0.03887923400605189, 
  3122.         -0.2652284115029323, -0.02382511495071679, 0.1052655941180719, 
  3123.         0.04260912557289683}, {0, 0, 0, 0, 0, 0}}, 
  3124.       {10.11839827297436, 10.02820571021069, 
  3125.        {0.5243110445567232, 0.3286160469143597, -0.03363083797187575, 
  3126.         -0.2670957301003645, 0.01928611835701936, 0.1013986365061166}, {0, 0, 0, 0, 0}}, 
  3127.       {10.20859083573802, 10.11839827297436, 
  3128.        {0.5534807334452517, 0.3160777659651972, -0.1047203947119751, 
  3129.         -0.2545006869000079, 0.05880905504737257, 0.0958956747933689}, {0, 0, 0, 0, 0}}, 
  3130.       {10.28195018450933, 10.20859083573802, 
  3131.        {0.5760057417968808, 0.2967065066510534, -0.1585198772399818, 
  3132.         -0.2325092426889391, 0.0927387734025662, 0.0945385167162797}, {0, 0, 0, 0, 0}}, 
  3133.       {10.35530953328063, 10.28195018450933, 
  3134.        {0.5968292778425191, 0.2698290110341504, -0.2066914354539432, 
  3135.         -0.2025565357801663, 0.1205565982637941, 0.0870590661985716}, {0, 0, 0, 0, 0}}, 
  3136.       {10.42866888205193, 10.35530953328063, 
  3137.        {0.6154342050283583, 0.2363997813846856, -0.2475513361586664, 
  3138.         -0.1657912263654681, 0.1428627900997082, 0.07656083759632815}, {0, 0, 0, 0, 0}}, 
  3139.       {10.50202823082324, 10.42866888205193, 
  3140.        {0.6313813966338618, 0.1975780452331655, -0.279994299286265, 
  3141.         -0.1252916920896204, 0.1547568061582222, 0.05890719137412586}, {0, 0, 0, 0, 0}}, 
  3142.       {10.57538757959454, 10.50202823082324, 
  3143.        {0.6443221541181634, 0.1546586690630232, -0.3033196519970075, 
  3144.         -0.0829505719675924, 0.1581351288951365, 0.03902845084094563}, {0, 0, 0, 0, 0}}, 
  3145.       {10.64874692836584, 10.57538757959454, 
  3146.        {0.6540055443540834, 0.1090001920609028, -0.3173369422342247, 
  3147.         -0.04094805950031009, 0.1534621123330389, 0.01832104210151739}, {0, 0, 0, 0, 0}}\
  3148.        , {10.74639726477455, 10.64874692836584, 
  3149.        {0.6615948197853268, 0.04629678831440084, -0.3218307436921243, 
  3150.         0.01381803991288055, 0.1472144943357499, 0.005874266654430996}, {0, 0, 0, 0, 0}}\
  3151.        , {10.82722328964177, 10.74639726477455, 
  3152.        {0.6632428652335776, -0.005324694218945352, -0.3149970427060306, 
  3153.         0.04841183090586396, 0.1141021499989971, -0.02924938319323956}, {0, 0, 0, 0, 0}}\
  3154.        , {10.90804931450899, 10.82722328964177, 
  3155.        {0.660784545321828, -0.05507703355813173, -0.2991461033877231, 
  3156.         0.0822019250565668, 0.0991298993087322, -0.03236886737304884}, {0, 0, 0, 0, 0}}, 
  3157.       {10.98887533937621, 10.90804931450899, 
  3158.        {0.6544243258481738, -0.1016853450272458, -0.2763270711688095, 
  3159.         0.1073568245162611, 0.073377016972984, -0.04491101375273427}, {0, 0, 0, 0, 0}}, 
  3160.       {11.06970136424343, 10.98887533937621, 
  3161.        {0.6444596000124016, -0.1441177028986253, -0.2478233071144678, 
  3162.         0.127182107420892, 0.0526717937123201, -0.04744022851286556}, {0, 0, 0, 0, 0}}, 
  3163.       {11.15052738911065, 11.06970136424343, 
  3164.        {0.631261507208081, -0.1815808703225139, -0.2151153183241039, 
  3165.         0.1414296542968379, 0.03434215231675288, -0.0466064534477142}, {0, 0, 0, 0, 0}}, 
  3166.       {11.23135341397787, 11.15052738911065, 
  3167.        {0.6152562970919899, -0.2134996442535727, -0.1794555116063093, 
  3168.         0.1510248353571255, 0.01958183877111461, -0.04257333833386826}, {0, 0, 0, 0, 0}}\
  3169.        , {11.31217943884509, 11.23135341397787, 
  3170.        {0.5969089166028525, -0.2394860235842585, -0.1418951931021953, 
  3171.         0.1568686820710572, 0.0084590695235387, -0.03655309990033395}, {0, 0, 0, 0, 0}}, 
  3172.       {11.39300546371231, 11.31217943884509, 
  3173.        {0.5767092909545081, -0.2593040107324199, -0.1032657866383609, 
  3174.         0.1598347008338987, 0.0006306763602209588, -0.02968024858227772}, 
  3175.        {0, 0, 0, 0, 0}}, {11.47383148857953, 11.39300546371231, 
  3176.        {0.555161462956511, -0.2728347304648509, -0.06419183394898976, 
  3177.         0.1606951551819782, -0.004482773708941145, -0.02286934084108967}, 
  3178.        {0, 0, 0, 0, 0}}, {11.59181245841113, 11.47383148857953, 
  3179.        {0.5223442673578611, -0.2812468845498115, -0.007394887048796007, 
  3180.         0.1580464444981146, -0.01316017084926057, -0.01960553453350806}, 
  3181.        {0, 0, 0, 0, 0}}, {11.70979342824274, 11.59181245841113, 
  3182.        {0.4893232303415929, -0.2763242270947273, 0.04865287772256473, 
  3183.         0.1551563588504771, -0.01373801044890675, -0.01215513957053192}, 
  3184.        {0, 0, 0, 0, 0}}, {11.80584992308493, 11.70979342824274, 
  3185.        {0.4633677661579008, -0.2626733185467185, 0.0931804529562815, 
  3186.         0.1520819388617651, -0.01215702453645389, -0.005976370351891731}, 
  3187.        {0, 0, 0, 0, 0}}, {11.90190641792712, 11.80584992308493, 
  3188.        {0.4391290731687388, -0.2406284706283534, 0.1360586485835396, 
  3189.         0.1457848981139132, -0.01742454313757883, -0.007972839338736143}, 
  3190.        {0, 0, 0, 0, 0}}, {11.9979629127693, 11.90190641792712, 
  3191.        {0.4173979844024994, -0.2105260018635804, 0.1769646555211598, 
  3192.         0.1380169033702004, -0.02200641933696511, -0.00859968810853848}, 
  3193.        {0, 0, 0, 0, 0}}, {12.09401940761149, 11.9979629127693, 
  3194.        {0.398927356039935, -0.1728332477770082, 0.214974344301008, 0.1264940676230905, 
  3195.         -0.03120942203231142, -0.0128244712189106}, {0, 0, 0, 0, 0}}, 
  3196.       {12.19007590245367, 12.09401940761149, 
  3197.        {0.3844166644314174, -0.1282029524815155, 0.248994784061794, 
  3198.         0.1104537137089057, -0.04376143153057608, -0.01814853867842145}, 
  3199.        {0, 0, 0, 0, 0}}, {12.28613239729586, 12.19007590245367, 
  3200.        {0.3744912322465356, -0.0775379064844061, 0.2775396898867163, 
  3201.         0.0885594919975569, -0.06007473490422996, -0.0244755472384153}, {0, 0, 0, 0, 0}}\
  3202.        , {12.40706782178425, 12.28613239729586, 
  3203.        {0.3693118085405207, -0.007084303521196953, 0.303020952745073, 
  3204.         0.0522761835291899, -0.081329600513814, -0.02874563578365292}, {0, 0, 0, 0, 0}}, 
  3205.       {12.50286087027163, 12.40706782178425, 
  3206.        {0.3714489883574392, 0.05200117909541203, 0.3121156277680681, 
  3207.         0.01263947149656335, -0.1081519793992341, -0.03964765314665115}, 
  3208.        {0, 0, 0, 0, 0}}, {12.59865391875901, 12.50286087027163, 
  3209.        {0.37929712369363, 0.1117800509078115, 0.3097805285624411, 
  3210.         -0.03080410620627981, -0.1234833951392235, -0.03659237335821621}, 
  3211.        {0, 0, 0, 0, 0}}, {12.6944469672464, 12.59865391875901, 
  3212.        {0.3928102338944246, 0.1698466988686029, 0.2939664077959161, 
  3213.         -0.0807040980028567, -0.1392801578829901, -0.03514783243554475}, 
  3214.        {0, 0, 0, 0, 0}}, {12.79024001573378, 12.6944469672464, 
  3215.        {0.4116981978503496, 0.2235378919540917, 0.2638569200867295, 
  3216.         -0.1321307654595578, -0.1445565957769855, -0.02549523039634809}, 
  3217.        {0, 0, 0, 0, 0}}, {12.88603306422116, 12.79024001573378, 
  3218.        {0.4354094201338522, 0.2700866444524746, 0.2193753389513322, 
  3219.         -0.1817095105497374, -0.138534771265673, -0.01026810984261736}, {0, 0, 0, 0, 0}}\
  3220.        , {12.98182611270854, 12.88603306422116, 
  3221.        {0.4631304990029924, 0.3068340982607688, 0.1617421661615088, 
  3222.         -0.2245100395450224, -0.1183442992178811, 0.01070087708443486}, {0, 0, 0, 0, 0}}\
  3223.        , {13.07761916119592, 12.98182611270854, 
  3224.        {0.4938082232908022, 0.3314745865401102, 0.0934657994535938, 
  3225.         -0.2558921935413381, -0.084178343939482, 0.03495366582009388}, {0, 0, 0, 0, 0}}, 
  3226.       {13.17341220968331, 13.07761916119592, 
  3227.        {0.526195323955929, 0.3423015075131958, 0.01827395819179989, 
  3228.         -0.2719144759252239, -0.0383001421162368, 0.05928663048485494}, {0, 0, 0, 0, 0}}\
  3229.        , {13.26920525817069, 13.17341220968331, 
  3230.        {0.5589182085022293, 0.3384127185549844, -0.05922268642299255, 
  3231.         -0.2702690348914779, 0.0144357656264664, 0.07961351038571802}, {0, 0, 0, 0, 0}}, 
  3232.       {13.34529055189824, 13.26920525817069, 
  3233.        {0.5842073709612043, 0.3248259011907498, -0.1189644830260362, 
  3234.         -0.2545406982965879, 0.06366625856521065, 0.0995315843248776}, {0, 0, 0, 0, 0}}, 
  3235.       {13.42137584562579, 13.34529055189824, 
  3236.        {0.6081225950113734, 0.3023995396473645, -0.174849477823157, 
  3237.         -0.2320666441631217, 0.094027666037894, 0.0916424995334667}, {0, 0, 0, 0, 0}}, 
  3238.       {13.49746113935334, 13.42137584562579, 
  3239.        {0.6300194824899195, 0.2719342290580968, -0.2242750099152987, 
  3240.         -0.1989088658215938, 0.12673954251455, 0.0893804529353933}, {0, 0, 0, 0, 0}}, 
  3241.       {13.57354643308089, 13.49746113935334, 
  3242.        {0.6493267164701288, 0.2345332765884476, -0.2656579502168388, 
  3243.         -0.1599261711335242, 0.1473261541746312, 0.07527409649451351}, {0, 0, 0, 0, 0}}, 
  3244.       {13.64963172680845, 13.57354643308089, 
  3245.        {0.6655661380202626, 0.1915305390947954, -0.2977012469257547, 
  3246.         -0.1167907706215769, 0.1588961976686487, 0.05732979805870884}, {0, 0, 0, 0, 0}}, 
  3247.       {13.725717020536, 13.64963172680845, 
  3248.        {0.6783671989687339, 0.1444058887932825, -0.3197451816445415, 
  3249.         -0.07221181966234786, 0.1607138101048695, 0.03630901024806246}, {0, 0, 0, 0, 0}}\
  3250.        , {13.81616258822105, 13.725717020536, 
  3251.        {0.6887658255860129, 0.0851508630912317, -0.3326974156062862, 
  3252.         -0.01891700974891044, 0.1586092280965832, 0.01992388252781058}, {0, 0, 0, 0, 0}}\
  3253.        , {13.9066081559061, 13.81616258822105, 
  3254.        {0.693735885050009, 0.02477139597387578, -0.3323082713130168, 
  3255.         0.02765850595397063, 0.1381548898500533, -0.006137735153861817}, 
  3256.        {0, 0, 0, 0, 0}}, {13.99705372359115, 13.9066081559061, 
  3257.        {0.693282650847917, -0.03441176335462481, -0.3198776263466756, 
  3258.         0.06780107894248429, 0.1132570294540206, -0.02570504509356737}, {0, 0, 0, 0, 0}}\
  3259.        , {14.0874992912762, 13.99705372359115, 
  3260.        {0.68760758042033, -0.0903965566050469, -0.2974050114007652, 
  3261.         0.1000010309251843, 0.0858258481607831, -0.03968617847004545}, {0, 0, 0, 0, 0}}, 
  3262.       {14.17794485896125, 14.0874992912762, 
  3263.        {0.6770763790249358, -0.1415577631132362, -0.2670218317947417, 
  3264.         0.1243495098879304, 0.0596922706687734, -0.04692711508787836}, {0, 0, 0, 0, 0}}, 
  3265.       {14.26839042664631, 14.17794485896125, 
  3266.        {0.6621841356036285, -0.1866577814557311, -0.2308227828664591, 
  3267.         0.1414656036771822, 0.03695259634280172, -0.04826973610964731}, {0, 0, 0, 0, 0}}\
  3268.        , {14.35883599433136, 14.26839042664631, 
  3269.        {0.6435212479090657, -0.2248194878403949, -0.1906687972610346, 
  3270.         0.1524985996623536, 0.01894490191143855, -0.04488982566082009}, {0, 0, 0, 0, 0}}\
  3271.        , {14.44928156201641, 14.35883599433136, 
  3272.        {0.6217430201350812, -0.2554748980794561, -0.1481013370276437, 
  3273.         0.1587310661830852, 0.005872272203913244, -0.03849676578770611}, 
  3274.        {0, 0, 0, 0, 0}}, {14.53972712970146, 14.44928156201641, 
  3275.        {0.5975444966085004, -0.2783025332606808, -0.1043070147974663, 
  3276.         0.1614283349916259, -0.002718849492719389, -0.03069699166268835}, 
  3277.        {0, 0, 0, 0, 0}}, {14.65457731597528, 14.53972712970146, 
  3278.        {0.5644534156746646, -0.2958067422360194, -0.04836626227979492, 
  3279.         0.1601964949934928, -0.01275977011395601, -0.02541229466571317}, 
  3280.        {0, 0, 0, 0, 0}}, {14.76942750224909, 14.65457731597528, 
  3281.        {0.5300898218093128, -0.3004797616876909, 0.007220635167054081, 
  3282.         0.1582393591271797, -0.01381329485684457, -0.01598121957465988}, 
  3283.        {0, 0, 0, 0, 0}}, {14.88427768852291, 14.76942750224909, 
  3284.        {0.4959170394788845, -0.2925288644683147, 0.06156880606133047, 
  3285.         0.154507216155577, -0.01418083445175822, -0.00984474497861856}, {0, 0, 0, 0, 0}}\
  3286.        , {14.97987154147985, 14.88427768852291, 
  3287.        {0.4686509547023328, -0.2765293183864989, 0.1055192150553396, 
  3288.         0.1506461308998496, -0.01336979339986272, -0.005228107903593626}, 
  3289.        {0, 0, 0, 0, 0}}, {15.0754653944368, 14.97987154147985, 
  3290.        {0.4433104036370754, -0.2522965961755637, 0.1477005574466185, 
  3291.         0.1438724362881459, -0.0185219923577264, -0.0074486055484896}, {0, 0, 0, 0, 0}}, 
  3292.       {15.17105924739374, 15.0754653944368, 
  3293.        {0.4206656745681344, -0.2201971369092627, 0.1877116575239712, 
  3294.         0.1352880598803523, -0.02392336715484195, -0.00898943289039982}, 
  3295.        {0, 0, 0, 0, 0}}, {15.26665310035069, 15.17105924739374, 
  3296.        {0.4014460561179695, -0.1807349166760623, 0.2246024357487908, 
  3297.         0.1227944332049789, -0.03387891005245653, -0.01372519368933516}, 
  3298.        {0, 0, 0, 0, 0}}, {15.36224695330763, 15.26665310035069, 
  3299.        {0.3863237934040667, -0.1346085570715219, 0.2572178677137328, 
  3300.         0.1055478176270812, -0.04724901241874253, -0.01942420584873309}, 
  3301.        {0, 0, 0, 0, 0}}, {15.45784080626458, 15.36224695330763, 
  3302.        {0.3758924954708581, -0.0827759253770362, 0.2840227982475962, 
  3303.         0.0822694927297571, -0.06423641088211893, -0.02587083381616095}, 
  3304.        {0, 0, 0, 0, 0}}, {15.57832997735504, 15.45784080626458, 
  3305.        {0.370167578789177, -0.01133018047731466, 0.3068138945271789, 
  3306.         0.04407354682882254, -0.0860129222922154, -0.02998123460615833}, 
  3307.        {0, 0, 0, 0, 0}}, {15.67090937869032, 15.57832997735504, 
  3308.        {0.3717737374001531, 0.04623432238889108, 0.3133356255601736, 
  3309.         0.004318665804302685, -0.112235236422872, -0.04064804834395542}, 
  3310.        {0, 0, 0, 0, 0}}, {15.7634887800256, 15.67090937869032, 
  3311.        {0.3787359887477396, 0.1040349729031001, 0.3089349183194764, 
  3312.         -0.0382370880677184, -0.1252857312849275, -0.03566606318488544}, 
  3313.        {0, 0, 0, 0, 0}}, {15.85606818136089, 15.7634887800256, 
  3314.        {0.3909761504862002, 0.1598613021289025, 0.2917944198024379, 
  3315.         -0.0866545967059144, -0.1393999982169567, -0.03359610211653865}, 
  3316.        {0, 0, 0, 0, 0}}, {15.94864758269617, 15.85606818136089, 
  3317.        {0.4082007856705573, 0.2113010663136555, 0.2613538001506114, 
  3318.         -0.1358031619705186, -0.1425609063065167, -0.02288907499174027}, 
  3319.        {0, 0, 0, 0, 0}}, {16.04122698403145, 15.94864758269617, 
  3320.        {0.4298890079840164, 0.2558776355948779, 0.2176690032188837, 
  3321.         -0.1827656258404966, -0.1351203371859133, -0.007303877282756253}, 
  3322.        {0, 0, 0, 0, 0}}, {16.13380638536673, 16.04122698403145, 
  3323.        {0.4552945477912358, 0.2912331533613683, 0.1619622328816131, 
  3324.         -0.2230409814284967, -0.1144568336973293, 0.01347348448291362}, {0, 0, 0, 0, 0}}\
  3325.        , {16.22638578670201, 16.13380638536673, 
  3326.        {0.4834662791951318, 0.315335168414679, 0.0965610657404389, 
  3327.         -0.2525521744443533, -0.0810941339779128, 0.03691357045584986}, {0, 0, 0, 0, 0}}\
  3328.        , {16.31896518803729, 16.22638578670201, 
  3329.        {0.5132879274981507, 0.326680889561829, 0.02483845613302437, 
  3330.         -0.2678343819543858, -0.03719320657733311, 0.06008394809415006}, 
  3331.        {0, 0, 0, 0, 0}}, {16.41154458937258, 16.31896518803729, 
  3332.        {0.543535350363631, 0.3244663907145489, -0.04908147924915569, 
  3333.         -0.2668612553518779, 0.01283205850168057, 0.07927835638502812}, {0, 0, 0, 0, 0}}\
  3334.        , {16.48753945002744, 16.41154458937258, 
  3335.        {0.5677950450564109, 0.3124891397963301, -0.1081637840076629, 
  3336.         -0.2524540435324316, 0.05967130091016895, 0.0968748138636686}, {0, 0, 0, 0, 0}}, 
  3337.       {16.5635343106823, 16.48753945002744, 
  3338.        {0.5908088072018933, 0.2917746710247719, -0.1635235112985145, 
  3339.         -0.2305440091471138, 0.0913393134586587, 0.0914618927162369}, {0, 0, 0, 0, 0}}, 
  3340.       {16.63952917133715, 16.5635343106823, 
  3341.        {0.611939578248448, 0.2630901317842986, -0.2126809822469957, 
  3342.         -0.1985002140478655, 0.1232625834590468, 0.0884828502533893}, {0, 0, 0, 0, 0}}, 
  3343.       {16.71552403199201, 16.63952917133715, 
  3344.        {0.6306205969628122, 0.2275033515725981, -0.2540091966115943, 
  3345.         -0.160420651041477, 0.1441955100441826, 0.07512585986505717}, {0, 0, 0, 0, 0}}, 
  3346.       {16.79151889264687, 16.71552403199201, 
  3347.        {0.6463754607109351, 0.1863127728626863, -0.2862167927057808, 
  3348.         -0.1181473495352618, 0.1561109995198374, 0.05761898464623729}, {0, 0, 0, 0, 0}}, 
  3349.       {16.86751375330173, 16.79151889264687, 
  3350.        {0.6588326244590668, 0.140964999658785, -0.3086204009662486, 
  3351.         -0.07430528670597876, 0.1584354748148664, 0.03701837235991574}, {0, 0, 0, 0, 0}}\
  3352.        , {16.9573373963983, 16.86751375330173, 
  3353.        {0.6689572751876935, 0.0840678487977356, -0.3221796087447629, 
  3354.         -0.02205249279192907, 0.1567896761146584, 0.02074521896316078}, {0, 0, 0, 0, 0}}\
  3355.        , {17.04716103949486, 16.9573373963983, 
  3356.        {0.6738972039591414, 0.02591673049225445, -0.3227000215571691, 
  3357.         0.02391005085664805, 0.1373720452254352, -0.00484687293528687}, {0, 0, 0, 0, 0}}\
  3358.        , {17.13698468259143, 17.04716103949486, 
  3359.        {0.6736430077591244, -0.03123135243244906, -0.3113964022017476, 
  3360.         0.0637609589177285, 0.1134500863024825, -0.02421383624244838}, {0, 0, 0, 0, 0}}, 
  3361.       {17.22680832568799, 17.13698468259143, 
  3362.        {0.6683752870165059, -0.0854178972538417, -0.2901661787338192, 
  3363.         0.0959810472128735, 0.0868580557030715, -0.03821207112527298}, {0, 0, 0, 0, 0}}, 
  3364.       {17.31663196878456, 17.22680832568799, 
  3365.        {0.6584347614646797, -0.1350411930146968, -0.2610502307788093, 
  3366.         0.1205935659264541, 0.0613178775501012, -0.04567419639247225}, {0, 0, 0, 0, 0}}, 
  3367.       {17.40645561188112, 17.31663196878456, 
  3368.        {0.6442893490445706, -0.1788695360895336, -0.2260696587753784, 
  3369.         0.1381433886527717, 0.03890524973407318, -0.0473659685568112}, {0, 0, 0, 0, 0}}, 
  3370.       {17.49627925497769, 17.40645561188112, 
  3371.        {0.6265017406866898, -0.2160179646186495, -0.1870341051242497, 
  3372.         0.1497019527052148, 0.02097636221557753, -0.04438765982732876}, {0, 0, 0, 0, 0}}\
  3373.        , {17.58610289807426, 17.49627925497769, 
  3374.        {0.6057002439769367, -0.2459013054288527, -0.1454555031234102, 
  3375.         0.1564862266383784, 0.007789766948012972, -0.03837702737387644}, 
  3376.        {0, 0, 0, 0, 0}}, {17.67592654117082, 17.58610289807426, 
  3377.        {0.5825544391400701, -0.2681756965161455, -0.102509888907195, 
  3378.         0.1597119263935478, -0.001040900673505633, -0.03089111018021603}, 
  3379.        {0, 0, 0, 0, 0}}, {17.78809170152554, 17.67592654117082, 
  3380.        {0.5514133736336725, -0.2850738500510505, -0.04835123975948569, 
  3381.         0.159231127925038, -0.01096697296571394, -0.02561427782415099}, {0, 0, 0, 0, 0}}\
  3382.        , {17.90025686188025, 17.78809170152554, 
  3383.        {0.5190589881792052, -0.2898197191303763, 0.00564741997268988, 
  3384.         0.1577758440122875, -0.01255561070970276, -0.01650163706248354}, 
  3385.        {0, 0, 0, 0, 0}}, {18.01242202223497, 17.90025686188025, 
  3386.        {0.4868472127870247, -0.2825671416878326, 0.05862262846130586, 
  3387.         0.154497475991156, -0.01334512129986281, -0.01046408799165712}, {0, 0, 0, 0, 0}}\
  3388.        , {18.12458718258969, 18.01242202223497, 
  3389.        {0.4561086914055118, -0.2636069909537495, 0.1100284648735684, 
  3390.         0.1495782470084806, -0.01465782344462026, -0.007214716526517396}, 
  3391.        {0, 0, 0, 0, 0}}, {18.23675234294441, 18.12458718258969, 
  3392.        {0.4281341146109898, -0.2333660657283888, 0.159162901826412, 
  3393.         0.1421370514883929, -0.01862210622603955, -0.00715629096986514}, 
  3394.        {0, 0, 0, 0, 0}}, {18.34891750329912, 18.23675234294441, 
  3395.        {0.4041563857662383, -0.1924613401733374, 0.204980867857199, 
  3396.         0.1307855834226644, -0.02664008123303626, -0.01001246654055602}, 
  3397.        {0, 0, 0, 0, 0}}, {18.46108266365384, 18.34891750329912, 
  3398.        {0.3853239721694287, -0.1418019933389327, 0.2458898395633981, 
  3399.         0.113631294968049, -0.03978681722903279, -0.01538417832474295}, {0, 0, 0, 0, 0}}\
  3400.        , {18.57324782400856, 18.46108266365384, 
  3401.        {0.3726608323947914, -0.0827229737026378, 0.279665408832092, 
  3402.         0.0886843035718445, -0.05827395928804635, -0.02241616428846458}, 
  3403.        {0, 0, 0, 0, 0}}, {18.68541298436327, 18.57324782400856, 
  3404.        {0.3670107019246238, -0.01712558609795381, 0.3034864569654791, 
  3405.         0.05428682916002126, -0.0812231904430705, -0.02981786928309137}, 
  3406.        {0, 0, 0, 0, 0}}, {18.79757814471799, 18.68541298436327, 
  3407.        {0.3689668028469599, 0.05241007020289891, 0.314157527728057, 
  3408.         0.00974935526452673, -0.1062456328595554, -0.03573757693018444}, 
  3409.        {0, 0, 0, 0, 0}}, {18.88310003685226, 18.79757814471799, 
  3410.        {0.3757462214217987, 0.1060568870827415, 0.3114512108145758, 
  3411.         -0.03096492461477897, -0.1259250434180483, -0.03985131618634714}, 
  3412.        {0, 0, 0, 0, 0}}, {18.96862192898653, 18.88310003685226, 
  3413.        {0.3870693636451664, 0.1583668458145753, 0.2982589997595443, 
  3414.         -0.0740776056142356, -0.135751064482087, -0.033102374059462}, {0, 0, 0, 0, 0}}, 
  3415.       {19.0541438211208, 18.96862192898653, 
  3416.        {0.4027421911657497, 0.2074512133191715, 0.2736118384568916, 
  3417.         -0.1200838195974883, -0.1427557954772318, -0.02641388095443363}, 
  3418.        {0, 0, 0, 0, 0}}, {19.13966571325507, 19.0541438211208, 
  3419.        {0.4224048336754759, 0.2513421775810297, 0.2374746076954741, 
  3420.         -0.1648370746385553, -0.1389827055338675, -0.01231885573317678}, 
  3421.        {0, 0, 0, 0, 0}}, {19.22518760538934, 19.13966571325507, 
  3422.        {0.4455297867859727, 0.2881070392846361, 0.1903977723222972, 
  3423.         -0.2056927945221893, -0.1252338397180049, 0.005469829336754457}, 
  3424.        {0, 0, 0, 0, 0}}, {19.31070949752361, 19.22518760538934, 
  3425.        {0.4714305548736463, 0.3159849696131609, 0.1338282441808758, 
  3426.         -0.239044316636845, -0.1001203829224711, 0.02677385379601075}, {0, 0, 0, 0, 0}}, 
  3427.       {19.39623138965789, 19.31070949752361, 
  3428.        {0.4992824989404001, 0.3335295546309788, 0.07000767759805954, 
  3429.         -0.2618620676895207, -0.06493347418990191, 0.04897930782267704}, 
  3430.        {0, 0, 0, 0, 0}}, {19.48175328179216, 19.39623138965789, 
  3431.        {0.5281554878348831, 0.3397402952255393, 0.001881374327006755, 
  3432.         -0.271752757465513, -0.02209055249767691, 0.06946426739839098}, {0, 0, 0, 0, 0}}\
  3433.        , {19.56727517392643, 19.48175328179216, 
  3434.        {0.5570566545546578, 0.3341639206701895, -0.06714196207222522, 
  3435.         -0.2674954295656995, 0.02448494328327447, 0.0852468161159105}, {0, 0, 0, 0, 0}}, 
  3436.       {19.6527970660607, 19.56727517392643, 
  3437.        {0.584979934638746, 0.3169495831936897, -0.1334921107263777, 
  3438.         -0.2492160826389732, 0.07012893275615801, 0.093844983607507}, {0, 0, 0, 0, 0}}, 
  3439.       {19.73831895819497, 19.6527970660607, 
  3440.        {0.6109579727716066, 0.2888480538614692, -0.1937776556502415, 
  3441.         -0.2184154743136921, 0.1101240243375795, 0.0937197186094067}, {0, 0, 0, 0, 0}}, 
  3442.       {19.82384085032924, 19.73831895819497, 
  3443.        {0.6341114852623515, 0.251153680201149, -0.2451036307003585, 
  3444.         -0.1777464392301028, 0.1405335685110858, 0.0846779222561103}, {0, 0, 0, 0, 0}}, 
  3445.       {19.91948351282646, 19.82384085032924, 
  3446.        {0.6557429257050346, 0.1997783549585104, -0.2893333784991141, 
  3447.         -0.1260535524760782, 0.1504410520448309, 0.03298659682166996, 
  3448.         -0.04177294003025148}, {0, 0, 0, 0, 0, 0}}, 
  3449.       {20., 19.91948351282646, {0.6698916275074934, 0.1509924669492211, 
  3450.         -0.3146671120037508, -0.0819041403777226, 0.1385277101812288, 
  3451.         -0.02424469121909889, -0.06733763215489301}, {0, 0, 0, 0, 0, 0}}}]}}
  3452.  
  3453.  
  3454.  
  3455.  
  3456.  
  3457.  
  3458.  
  3459.  
  3460.  
  3461.  
  3462.  
  3463.  
  3464.  
  3465.  
  3466.  
  3467.  
  3468. ;[o]
  3469. {{y -> InterpolatingFunction[{0., 20.}, <>]}}
  3470. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  3471. Plot[ Evaluate[ y[x] /. %], {x, 0, 20} ]
  3472. :[font = postscript; inactive; formatted; output; BITMAP; pictureLeft = 100; pictureTop = 0; pictureWidth = 299; pictureHeight = 185; nowordwrap; ]
  3473. :[font = output; inactive; formatted; output; endGroup; endGroup; nowordwrap; ]
  3474. No Input Form was saved for this expression.
  3475.  
  3476.  
  3477.  
  3478.  
  3479.  
  3480.  
  3481.  
  3482.  
  3483.  
  3484.  
  3485.  
  3486.  
  3487.  
  3488.  
  3489.  
  3490.  
  3491. ;[o]
  3492. -Graphics-
  3493. :[font = subsection; inactive; preserveAspect; startGroup; nohscroll; ]
  3494. Solving Equations
  3495. :[font = text; inactive; preserveAspect; nohscroll; ]
  3496. This is how you solve a quadratic equation in Mathematica.
  3497. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  3498. Solve[x^2 + 2 a x + 1 == 0, x]
  3499. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  3500. {{x -> (-2*a + (-4 + 4*a^2)^(1/2))/2}, 
  3501.    {x -> (-2*a - (-4 + 4*a^2)^(1/2))/2}}
  3502.  
  3503.  
  3504.  
  3505.  
  3506.  
  3507.  
  3508.  
  3509.  
  3510.  
  3511.  
  3512.  
  3513.  
  3514.  
  3515.  
  3516.  
  3517.  
  3518.  
  3519.  
  3520.  
  3521.  
  3522.  
  3523.  
  3524.  
  3525.  
  3526.  
  3527.  
  3528.  
  3529.  
  3530.  
  3531.  
  3532.  
  3533.  
  3534.  
  3535.  
  3536.  
  3537.  
  3538.  
  3539.  
  3540.  
  3541.  
  3542.  
  3543.  
  3544.  
  3545.  
  3546.  
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.  
  3572.  
  3573.  
  3574.  
  3575.  
  3576.  
  3577.  
  3578.  
  3579.  
  3580.  
  3581.  
  3582.  
  3583.  
  3584.  
  3585.  
  3586.  
  3587.  
  3588.  
  3589. ;[o]
  3590.                            2
  3591.        -2 a + Sqrt[-4 + 4 a ]
  3592. {{x -> ----------------------}, 
  3593.                  2
  3594.  
  3595.                              2
  3596.          -2 a - Sqrt[-4 + 4 a ]
  3597.    {x -> ----------------------}}
  3598.                    2
  3599. :[font = text; inactive; preserveAspect; nohscroll; ]
  3600. Here's a more complicated example.
  3601. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  3602. Solve[x^5 + 3x + 1 == 0, x]
  3603. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  3604. {ToRules[Roots[3*x + x^5 == -1, x]]}
  3605.  
  3606.  
  3607.  
  3608.  
  3609.  
  3610.  
  3611.  
  3612.  
  3613.  
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.  
  3627.  
  3628.  
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634.  
  3635.  
  3636.  
  3637.  
  3638.  
  3639.  
  3640.  
  3641.  
  3642.  
  3643.  
  3644.  
  3645.  
  3646.  
  3647.  
  3648.  
  3649.  
  3650.  
  3651.  
  3652.  
  3653.  
  3654.  
  3655.  
  3656.  
  3657.  
  3658.  
  3659.  
  3660.  
  3661.  
  3662.  
  3663.  
  3664.  
  3665.  
  3666.  
  3667.  
  3668.  
  3669.  
  3670.  
  3671.  
  3672.  
  3673.  
  3674.  
  3675.  
  3676.  
  3677.  
  3678.  
  3679.  
  3680.  
  3681.  
  3682.  
  3683.  
  3684.  
  3685.  
  3686.  
  3687.  
  3688.  
  3689.  
  3690.  
  3691.  
  3692. ;[o]
  3693.                       5
  3694. {ToRules[Roots[3 x + x  == -1, x]]}
  3695. :[font = text; inactive; preserveAspect; nohscroll; ]
  3696. It is a fact of mathematics that there is no way to get an exact formula for the solutions of a quintic equation like this.  You can nevertheless ask Mathematica to give you numerical results.  You get the five complex number roots to the equation.
  3697. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  3698. N[%]
  3699. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  3700. {{x -> -0.839072 - 0.943852*I}, 
  3701.    {x -> -0.839072 + 0.943852*I}, {x -> -0.331989}, 
  3702.    {x -> 1.00507 - 0.937259*I}, {x -> 1.00507 + 0.937259*I}}
  3703.  
  3704.  
  3705.  
  3706.  
  3707.  
  3708.  
  3709.  
  3710.  
  3711.  
  3712.  
  3713.  
  3714.  
  3715.  
  3716.  
  3717.  
  3718.  
  3719.  
  3720.  
  3721.  
  3722.  
  3723.  
  3724.  
  3725.  
  3726.  
  3727.  
  3728.  
  3729.  
  3730.  
  3731.  
  3732.  
  3733.  
  3734.  
  3735.  
  3736.  
  3737.  
  3738.  
  3739.  
  3740.  
  3741.  
  3742.  
  3743.  
  3744.  
  3745.  
  3746.  
  3747.  
  3748.  
  3749.  
  3750.  
  3751.  
  3752.  
  3753.  
  3754.  
  3755.  
  3756.  
  3757.  
  3758.  
  3759.  
  3760.  
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766.  
  3767.  
  3768.  
  3769.  
  3770.  
  3771.  
  3772.  
  3773.  
  3774.  
  3775.  
  3776.  
  3777.  
  3778.  
  3779.  
  3780.  
  3781.  
  3782.  
  3783.  
  3784.  
  3785.  
  3786.  
  3787.  
  3788.  
  3789.  
  3790. ;[o]
  3791. {{x -> -0.839072 - 0.943852 I}, 
  3792.  
  3793.    {x -> -0.839072 + 0.943852 I}, {x -> -0.331989}, 
  3794.  
  3795.    {x -> 1.00507 - 0.937259 I}, {x -> 1.00507 + 0.937259 I}}
  3796. :[font = text; inactive; preserveAspect; nohscroll; ]
  3797. When equations contain complicated functions there is in general no systematic procedure for finding all solutions, even numerically.  The Mathematica function FindRoot searches for a numerical solution to an equation, starting at a specified point.  
  3798. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  3799. FindRoot[{Sin[x] == x - y, Cos[y] == x + y},
  3800.                          {x, 1}, {y, 0}]
  3801. :[font = output; inactive; formatted; output; preserveAspect; endGroup; nowordwrap; ]
  3802. The Unformatted text for this cell was not generated.
  3803. Use options in the Actions Settings dialog box to control
  3804. when Unformatted text is generated.
  3805.  
  3806.  
  3807.  
  3808.  
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.  
  3835.  
  3836.  
  3837.  
  3838.  
  3839.  
  3840.  
  3841.  
  3842.  
  3843.  
  3844.  
  3845.  
  3846.  
  3847.  
  3848.  
  3849.  
  3850.  
  3851.  
  3852.  
  3853.  
  3854.  
  3855.  
  3856.  
  3857.  
  3858.  
  3859.  
  3860.  
  3861.  
  3862.  
  3863.  
  3864.  
  3865.  
  3866.  
  3867.  
  3868.  
  3869.  
  3870.  
  3871.  
  3872.  
  3873.  
  3874.  
  3875.  
  3876.  
  3877.  
  3878.  
  3879.  
  3880.  
  3881.  
  3882.  
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.  
  3892. ;[o]
  3893. {x -> 0.883402, y -> 0.1105}
  3894. :[font = text; inactive; preserveAspect; nohscroll; ]
  3895. Mathematica also has an efficient routine for finding the solution to linear equations. 
  3896. Here's a simple example.
  3897. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  3898. LinearSolve[{{1.02, 5.9}, {2.87, 1.9}}, {1.9, 1.06}]
  3899. :[font = output; inactive; formatted; output; preserveAspect; endGroup; endGroup; endGroup; nowordwrap; ]
  3900. The Unformatted text for this cell was not generated.
  3901. Use options in the Actions Settings dialog box to control
  3902. when Unformatted text is generated.
  3903.  
  3904.  
  3905.  
  3906.  
  3907.  
  3908.  
  3909.  
  3910.  
  3911.  
  3912.  
  3913.  
  3914.  
  3915.  
  3916.  
  3917.  
  3918.  
  3919.  
  3920.  
  3921.  
  3922.  
  3923.  
  3924.  
  3925.  
  3926.  
  3927.  
  3928.  
  3929.  
  3930.  
  3931.  
  3932.  
  3933.  
  3934.  
  3935.  
  3936.  
  3937.  
  3938.  
  3939.  
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964.  
  3965.  
  3966.  
  3967.  
  3968.  
  3969.  
  3970.  
  3971.  
  3972.  
  3973.  
  3974.  
  3975.  
  3976.  
  3977.  
  3978.  
  3979.  
  3980.  
  3981.  
  3982.  
  3983.  
  3984.  
  3985.  
  3986.  
  3987.  
  3988.  
  3989.  
  3990. ;[o]
  3991. {0.176325, 0.291551}
  3992. :[font = section; inactive; preserveAspect; startGroup; nohscroll; ]
  3993. Graphics
  3994. :[font = text; inactive; preserveAspect; nohscroll; ]
  3995. Here is a simple Mathematica  plot. 
  3996. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  3997. Plot[Sin[x], {x, 0, 2Pi}]
  3998. :[font = postscript; inactive; formatted; output; BITMAP; pictureLeft = 100; pictureTop = 0; pictureWidth = 299; pictureHeight = 185; nowordwrap; ]
  3999. :[font = output; inactive; formatted; output; endGroup; nowordwrap; ]
  4000. No Input Form was saved for this expression.
  4001.  
  4002.  
  4003.  
  4004.  
  4005.  
  4006.  
  4007.  
  4008.  
  4009.  
  4010.  
  4011.  
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017. ;[o]
  4018. -Graphics-
  4019. :[font = text; inactive; preserveAspect; nohscroll; ]
  4020. There are many options you can specify for a plot.  Using Show you can redraw the previous plot 
  4021. with specified options.
  4022. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  4023. Show[% , Frame -> True, 
  4024.             PlotLabel  -> "The Sine Function"]
  4025. :[font = postscript; inactive; formatted; output; BITMAP; pictureLeft = 100; pictureTop = 0; pictureWidth = 299; pictureHeight = 185; nowordwrap; ]
  4026. :[font = output; inactive; formatted; output; endGroup; nowordwrap; ]
  4027. No Input Form was saved for this expression.
  4028.  
  4029.  
  4030.  
  4031.  
  4032.  
  4033.  
  4034.  
  4035.  
  4036.  
  4037.  
  4038.  
  4039.  
  4040.  
  4041.  
  4042.  
  4043.  
  4044. ;[o]
  4045. -Graphics-
  4046. :[font = text; inactive; preserveAspect; nohscroll; ]
  4047. Now for some three-dimensional graphics.
  4048. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  4049. Plot3D[Sin[x] Sin[3 y], {x, -2, 2}, {y, -2, 2}]
  4050. :[font = postscript; inactive; formatted; output; BITMAP; pictureLeft = 100; pictureTop = 0; pictureWidth = 300; pictureHeight = 246; nowordwrap; ]
  4051. :[font = output; inactive; formatted; output; endGroup; nowordwrap; ]
  4052. No Input Form was saved for this expression.
  4053.  
  4054.  
  4055.  
  4056.  
  4057.  
  4058.  
  4059.  
  4060.  
  4061.  
  4062.  
  4063.  
  4064.  
  4065.  
  4066.  
  4067.  
  4068.  
  4069. ;[o]
  4070. -SurfaceGraphics-
  4071. :[font = text; inactive; preserveAspect; nohscroll; ]
  4072. Here is a contour plot of the same function.
  4073. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  4074. Show[ ContourGraphics[ % ], ContourShading -> False,
  4075.                             ContourSmoothing -> True]
  4076. :[font = postscript; inactive; formatted; output; BITMAP; pictureLeft = 100; pictureTop = 0; pictureWidth = 300; pictureHeight = 300; nowordwrap; ]
  4077. :[font = output; inactive; formatted; output; endGroup; nowordwrap; ]
  4078. No Input Form was saved for this expression.
  4079.  
  4080.  
  4081.  
  4082.  
  4083.  
  4084.  
  4085.  
  4086.  
  4087.  
  4088.  
  4089.  
  4090.  
  4091.  
  4092.  
  4093.  
  4094.  
  4095. ;[o]
  4096. -ContourGraphics-
  4097. :[font = text; inactive; preserveAspect; nohscroll; ]
  4098. This generates a three-dimensional parametric surface.
  4099. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  4100. ParametricPlot3D[ {u Sin[t], u Cos[t], t/3},
  4101.               {t, 0, 12}, {u, -1, 1}, Ticks -> None]
  4102. :[font = postscript; inactive; formatted; output; BITMAP; pictureLeft = 100; pictureTop = 0; pictureWidth = 187; pictureHeight = 300; nowordwrap; ]
  4103. :[font = output; inactive; formatted; output; endGroup; nowordwrap; ]
  4104. No Input Form was saved for this expression.
  4105.  
  4106.  
  4107.  
  4108.  
  4109.  
  4110.  
  4111.  
  4112.  
  4113.  
  4114.  
  4115.  
  4116.  
  4117.  
  4118.  
  4119.  
  4120.  
  4121. ;[o]
  4122. -Graphics3D-
  4123. :[font = text; inactive; preserveAspect; endGroup; nohscroll; ]
  4124. Mathematica generates all graphics in PostScript, so that you can resize pictures, and make use of 
  4125. the resolution available on different types of printers.  However, due to space limitations, all of the
  4126. graphics on this disk have been re-rendered into bitmap form.  Resizing bitmaps may cause considerable
  4127. distortion of the graphic.
  4128. :[font = section; inactive; preserveAspect; startGroup; nohscroll; ]
  4129. Animated Graphics 
  4130. :[font = text; inactive; preserveAspect; nohscroll; ]
  4131. You can use sequences of graphics cells in a notebook as frames in a "movie".
  4132. :[font = text; inactive; preserveAspect; nohscroll; ]
  4133. This notebook contains a sample of animation in Mathematica.  Due to disk space limitations, this is 
  4134. a simple black and white example.  Look at the Color Movie notebook on your disk for an 
  4135. example of animated  color graphics.
  4136. :[font = text; inactive; preserveAspect; nohscroll; ]
  4137. To view the movie:
  4138. :[font = smalltext; inactive; preserveAspect; nohscroll; ]
  4139. First select it by clicking (once) the bracket that spans the group containing the frames of the movie.
  4140.  
  4141. Often the movie group will be closed, so that only the first frame is visible.  In this case the group's
  4142. bracket has an angle at the bottom.  Simply click this bracket; you do not have to open the 
  4143. group to be able to see the movie.
  4144.  
  4145. You should be sure to click the correct bracket.  Clicking the innermost bracket selects only 
  4146. a  single frame, and clicking a bracket too far to the right might select several movies at once.
  4147.  
  4148. :[font = text; inactive; preserveAspect; nohscroll; ]
  4149. Once you have selected the group of cells that make up the movie, you can start the movie by 
  4150. pressing Ctrl+Y. (As an alternative, you can choose the Animate Selected Graphics command in the 
  4151. Graph menu.)  You can stop the movie by clicking anywhere inside the window.
  4152. :[font = text; inactive; preserveAspect; nohscroll; ]
  4153. For information on other controls for viewing Mathematica movies, see the notebook 
  4154. READ1ST.MA.
  4155. :[font = text; inactive; preserveAspect; nohscroll; ]
  4156.  
  4157.  
  4158. :[font = input; locked; nowordwrap; ]
  4159. Do[Plot3D[Cos[Sqrt[x^2 + y^2]+Abs[n-2Pi]]/
  4160.     Sqrt[x^2 + y^2 + 1/4],
  4161.     {x,-4Pi,4Pi},{y,-4Pi,4Pi},
  4162.     PlotPoints->26,Lighting->True,PlotRange->{-2,2},
  4163.     BoxRatios->{1,1,1},Boxed->False,Axes->None],
  4164.     {n, 0, 2Pi - (2Pi/16), 2Pi/16}]
  4165. :[font = postscript; inactive; formatted; output; startGroup; Cclosed; BITMAP; pictureLeft = 100; pictureTop = 0; pictureWidth = 278; pictureHeight = 300; nowordwrap; ]
  4166. :[font = postscript; inactive; formatted; output; BITMAP; pictureLeft = 100; pictureTop = 0; pictureWidth = 278; pictureHeight = 300; nowordwrap; ]
  4167. :[font = postscript; inactive; formatted; output; BITMAP; pictureLeft = 100; pictureTop = 0; pictureWidth = 278; pictureHeight = 300; nowordwrap; ]
  4168. :[font = postscript; inactive; formatted; output; BITMAP; pictureLeft = 100; pictureTop = 0; pictureWidth = 278; pictureHeight = 300; nowordwrap; ]
  4169. :[font = postscript; inactive; formatted; output; BITMAP; pictureLeft = 100; pictureTop = 0; pictureWidth = 278; pictureHeight = 300; nowordwrap; ]
  4170. :[font = postscript; inactive; formatted; output; BITMAP; pictureLeft = 100; pictureTop = 0; pictureWidth = 278; pictureHeight = 300; nowordwrap; ]
  4171. :[font = postscript; inactive; formatted; output; BITMAP; pictureLeft = 100; pictureTop = 0; pictureWidth = 278; pictureHeight = 300; nowordwrap; ]
  4172. :[font = postscript; inactive; formatted; output; BITMAP; pictureLeft = 100; pictureTop = 0; pictureWidth = 278; pictureHeight = 300; nowordwrap; ]
  4173. :[font = postscript; inactive; formatted; output; BITMAP; pictureLeft = 100; pictureTop = 0; pictureWidth = 278; pictureHeight = 300; nowordwrap; ]
  4174. :[font = postscript; inactive; formatted; output; BITMAP; pictureLeft = 100; pictureTop = 0; pictureWidth = 278; pictureHeight = 300; nowordwrap; ]
  4175. :[font = postscript; inactive; formatted; output; endGroup; endGroup; BITMAP; pictureLeft = 100; pictureTop = 0; pictureWidth = 278; pictureHeight = 300; nowordwrap; ]
  4176. :[font = section; inactive; preserveAspect; startGroup; nohscroll; ]
  4177. Programming in Mathematica
  4178. :[font = text; inactive; preserveAspect; nohscroll; ]
  4179.  
  4180. You can use Mathematica not only as a "calculator", but also as a full symbolic programming language.
  4181.  
  4182. Many application packages covering specific areas have been or are being written in the Mathematica language.
  4183. :[font = subsection; inactive; preserveAspect; startGroup; nohscroll; ]
  4184.  A Graphics Application Package
  4185. :[font = input; preserveAspect; nowordwrap; ]
  4186.  
  4187. Needs["Graphics`Polyhedra`"]
  4188.  
  4189. :[font = text; inactive; preserveAspect; nohscroll; ]
  4190. This loads in a package that defines properties of polyhedra.  The package defines, among other things, the geometry of a dodecahedron.
  4191. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  4192.  
  4193. Dodecahedron[ ] // Short
  4194.  
  4195. :[font = output; inactive; formatted; output; endGroup; nowordwrap; ]
  4196. Short[{Polygon[{{0.5257311121191336, 0.3819660112501051, 0.85065080835204}, 
  4197.      {-0.2008114158862272, 0.6180339887498949, 0.85065080835204}, 
  4198.      {-0.6498393924658127, 0., 0.85065080835204}, 
  4199.      {-0.2008114158862272, -0.6180339887498949, 0.85065080835204}, 
  4200.      {0.5257311121191336, -0.3819660112501051, 0.85065080835204}}], 
  4201.    Polygon[{{0.5257311121191336, 0.3819660112501051, 0.85065080835204}, 
  4202.      {0.5257311121191336, -0.3819660112501051, 0.85065080835204}, 
  4203.      {0.85065080835204, -0.6180339887498949, 0.2008114158862273}, 
  4204.      {1.051462224238267, 0., -0.2008114158862273}, 
  4205.      {0.85065080835204, 0.6180339887498949, 0.2008114158862273}}], 
  4206.    Polygon[{{0.5257311121191336, 0.3819660112501051, 0.85065080835204}, 
  4207.      {0.85065080835204, 0.6180339887498949, 0.2008114158862273}, 
  4208.      {0.3249196962329063, 1., -0.2008114158862273}, 
  4209.      {-0.3249196962329063, 1., 0.2008114158862273}, 
  4210.      {-0.2008114158862272, 0.6180339887498949, 0.85065080835204}}], 
  4211.    Polygon[{{-0.2008114158862272, 0.6180339887498949, 0.85065080835204}, 
  4212.      {-0.3249196962329063, 1., 0.2008114158862273}, 
  4213.      {-0.85065080835204, 0.618033988749895, -0.2008114158862273}, 
  4214.      {-1.051462224238267, 0., 0.2008114158862273}, 
  4215.      {-0.6498393924658127, 0., 0.85065080835204}}], 
  4216.    Polygon[{{-0.6498393924658127, 0., 0.85065080835204}, 
  4217.      {-1.051462224238267, 0., 0.2008114158862273}, 
  4218.      {-0.85065080835204, -0.618033988749895, -0.2008114158862273}, 
  4219.      {-0.3249196962329063, -1., 0.2008114158862273}, 
  4220.      {-0.2008114158862272, -0.6180339887498949, 0.85065080835204}}], 
  4221.    Polygon[{{-0.2008114158862272, -0.6180339887498949, 0.85065080835204}, 
  4222.      {0.5257311121191336, -0.3819660112501051, 0.85065080835204}, 
  4223.      {0.85065080835204, -0.6180339887498949, 0.2008114158862273}, 
  4224.      {0.3249196962329063, -1., -0.2008114158862273}, 
  4225.      {-0.3249196962329063, -1., 0.2008114158862273}}], 
  4226.    Polygon[{{0.85065080835204, 0.6180339887498949, 0.2008114158862273}, 
  4227.      {1.051462224238267, 0., -0.2008114158862273}, 
  4228.      {0.6498393924658128, 0., -0.85065080835204}, 
  4229.      {0.2008114158862273, 0.618033988749895, -0.85065080835204}, 
  4230.      {0.3249196962329063, 1., -0.2008114158862273}}], 
  4231.    Polygon[{{-0.3249196962329063, 1., 0.2008114158862273}, 
  4232.      {0.3249196962329063, 1., -0.2008114158862273}, 
  4233.      {0.2008114158862273, 0.618033988749895, -0.85065080835204}, 
  4234.      {-0.5257311121191338, 0.3819660112501052, -0.85065080835204}, 
  4235.      {-0.85065080835204, 0.618033988749895, -0.2008114158862273}}], 
  4236.    Polygon[{{-1.051462224238267, 0., 0.2008114158862273}, 
  4237.      {-0.85065080835204, 0.618033988749895, -0.2008114158862273}, 
  4238.      {-0.5257311121191338, 0.3819660112501052, -0.85065080835204}, 
  4239.      {-0.5257311121191338, -0.3819660112501052, -0.85065080835204}, 
  4240.      {-0.85065080835204, -0.618033988749895, -0.2008114158862273}}], 
  4241.    Polygon[{{-0.3249196962329063, -1., 0.2008114158862273}, 
  4242.      {-0.85065080835204, -0.618033988749895, -0.2008114158862273}, 
  4243.      {-0.5257311121191338, -0.3819660112501052, -0.85065080835204}, 
  4244.      {0.2008114158862273, -0.618033988749895, -0.85065080835204}, 
  4245.      {0.3249196962329063, -1., -0.2008114158862273}}], 
  4246.    Polygon[{{0.85065080835204, -0.6180339887498949, 0.2008114158862273}, 
  4247.      {0.3249196962329063, -1., -0.2008114158862273}, 
  4248.      {0.2008114158862273, -0.618033988749895, -0.85065080835204}, 
  4249.      {0.6498393924658128, 0., -0.85065080835204}, 
  4250.      {1.051462224238267, 0., -0.2008114158862273}}], 
  4251.    Polygon[{{0.2008114158862273, 0.618033988749895, -0.85065080835204}, 
  4252.      {0.6498393924658128, 0., -0.85065080835204}, 
  4253.      {0.2008114158862273, -0.618033988749895, -0.85065080835204}, 
  4254.      {-0.5257311121191338, -0.3819660112501052, -0.85065080835204}, 
  4255.      {-0.5257311121191338, 0.3819660112501052, -0.85065080835204}}]}]
  4256.  
  4257.  
  4258.  
  4259.  
  4260.  
  4261.  
  4262.  
  4263.  
  4264.  
  4265.  
  4266.  
  4267.  
  4268.  
  4269.  
  4270.  
  4271. ;[o]
  4272. {Polygon[<<1>>], <<10>>, Polygon[{{0.200811, 0.618034, -0.850651}, <<4>>}]}
  4273. :[font = text; inactive; preserveAspect; nohscroll; ]
  4274. The Dodecahedron function gives the coordinates for the faces of a dodecahedron, shown here in shortened form.
  4275. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  4276.  
  4277. Show[Graphics3D[ % ]];
  4278.  
  4279. :[font = postscript; inactive; formatted; output; endGroup; BITMAP; pictureLeft = 100; pictureTop = 0; pictureWidth = 300; pictureHeight = 300; nowordwrap; ]
  4280. :[font = text; inactive; preserveAspect; nohscroll; ]
  4281.  
  4282. This shows the dodecahedron as a three-dimensional graphical object.
  4283.  
  4284. As another example, we can use the definitions from the polyhedra package to create an image of a stellated icosahedron, which is often used as an icon for the Mathematica system.
  4285. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  4286.  
  4287. Show[ Stellate[ Polyhedron[ Icosahedron ]] ];
  4288.  
  4289. :[font = postscript; inactive; formatted; output; endGroup; endGroup; BITMAP; pictureLeft = 100; pictureTop = 0; pictureWidth = 300; pictureHeight = 300; nowordwrap; ]
  4290. :[font = subsection; inactive; preserveAspect; startGroup; nohscroll; ]
  4291.   More on Programming
  4292. :[font = text; inactive; preserveAspect; nohscroll; ]
  4293. There are several styles of programming in Mathematica.  One of them is procedural programming, as you would find in a standard structured programming language such as C or Pascal.
  4294.  
  4295. Another is "rule-based programming".  The idea is to give transformation rules which specify how Mathematica should transform expressions it receives as input. 
  4296.  
  4297. You can give rules that mimic the formulas you might find in a mathematics textbook.
  4298.  
  4299. Here is an example of how you might teach Mathematica about a new form of logarithm function, called nlog.
  4300. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  4301. nlog[a b c d^2]
  4302.  
  4303. :[font = output; inactive; formatted; output; endGroup; nowordwrap; ]
  4304. nlog[a*b*c*d^2]
  4305.  
  4306.  
  4307.  
  4308.  
  4309.  
  4310.  
  4311.  
  4312.  
  4313.  
  4314.  
  4315.  
  4316.  
  4317.  
  4318.  
  4319.  
  4320.  
  4321.  
  4322.  
  4323.  
  4324.  
  4325.  
  4326.  
  4327.  
  4328.  
  4329.  
  4330.  
  4331.  
  4332.  
  4333.  
  4334.  
  4335.  
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352. ;[o]
  4353.             2
  4354. nlog[a b c d ]
  4355. :[font = text; inactive; preserveAspect; nohscroll; ]
  4356.  
  4357. Mathematica  initially knows nothing about our new function, so it does nothing to expressions involving nlogs.
  4358. :[font = input; preserveAspect; nowordwrap; ]
  4359.  
  4360. nlog[x_ y_] := nlog[x] + nlog[y]
  4361.  
  4362. :[font = text; inactive; preserveAspect; nohscroll; ]
  4363. This tells Mathematica how to expand logarithms of products.
  4364. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  4365.  
  4366. nlog[a b c d^2]
  4367.  
  4368. :[font = output; inactive; formatted; output; endGroup; nowordwrap; ]
  4369. nlog[a] + nlog[b] + nlog[c] + nlog[d^2]
  4370.  
  4371.  
  4372.  
  4373.  
  4374.  
  4375.  
  4376.  
  4377.  
  4378.  
  4379.  
  4380.  
  4381.  
  4382.  
  4383.  
  4384.  
  4385.  
  4386.  
  4387.  
  4388.  
  4389.  
  4390.  
  4391.  
  4392.  
  4393.  
  4394.  
  4395.  
  4396.  
  4397.  
  4398.  
  4399.  
  4400.  
  4401.  
  4402.  
  4403.  
  4404.  
  4405.  
  4406.  
  4407.  
  4408.  
  4409.  
  4410.  
  4411.  
  4412.  
  4413.  
  4414.  
  4415.  
  4416.  
  4417. ;[o]
  4418.                                     2
  4419. nlog[a] + nlog[b] + nlog[c] + nlog[d ]
  4420. :[font = text; inactive; preserveAspect; nohscroll; ]
  4421. Now Mathematica can expand the nlog out. 
  4422. :[font = input; preserveAspect; nowordwrap; ]
  4423.  
  4424. nlog[x_^n_] := n nlog[x]
  4425.  
  4426. :[font = text; inactive; preserveAspect; nohscroll; ]
  4427. This gives a rule for nlog of a power.
  4428. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  4429. nlog[a b c d^2]
  4430.  
  4431. :[font = output; inactive; formatted; output; endGroup; nowordwrap; ]
  4432. nlog[a] + nlog[b] + nlog[c] + 2*nlog[d]
  4433.  
  4434.  
  4435.  
  4436.  
  4437.  
  4438.  
  4439.  
  4440.  
  4441.  
  4442.  
  4443.  
  4444.  
  4445.  
  4446.  
  4447.  
  4448.  
  4449.  
  4450.  
  4451.  
  4452.  
  4453.  
  4454.  
  4455.  
  4456.  
  4457.  
  4458.  
  4459.  
  4460.  
  4461.  
  4462.  
  4463.  
  4464.  
  4465.  
  4466.  
  4467.  
  4468.  
  4469.  
  4470.  
  4471.  
  4472.  
  4473.  
  4474.  
  4475.  
  4476.  
  4477.  
  4478.  
  4479.  
  4480. ;[o]
  4481. nlog[a] + nlog[b] + nlog[c] + 2 nlog[d]
  4482. :[font = text; inactive; preserveAspect; nohscroll; ]
  4483. Now Mathematica can expand the expression completely.
  4484. :[font = text; inactive; preserveAspect; nohscroll; ]
  4485.  
  4486. Another style of programming you can use in Mathematica is functional programming.  In functional programming, you specify a collection of functions to apply.  This style of programming often yields compact, elegant programs that make good use of Mathematica's many integrated capabilities.
  4487. :[font = text; inactive; preserveAspect; nohscroll; ]
  4488. This is a program that plots the solutions to a polynomial equation as points in the complex plane.
  4489. :[font = input; preserveAspect; nowordwrap; ]
  4490. RootPlot[poly_, z] :=
  4491.     ListPlot[{Re[z], Im[z]} /. NSolve[ poly == 0, z],
  4492.                         AspectRatio -> Automatic ]                          
  4493. :[font = text; inactive; preserveAspect; nohscroll; ]
  4494. You can immediately use the program to plot solutions.
  4495. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  4496.  
  4497. RootPlot[ z^7 - 1 , z];
  4498.  
  4499. :[font = postscript; inactive; formatted; output; endGroup; BITMAP; pictureLeft = 100; pictureTop = 0; pictureWidth = 292; pictureHeight = 300; nowordwrap; ]
  4500. :[font = text; inactive; preserveAspect; nohscroll; ]
  4501. Here is a program written in functional programming style, which finds the first n terms in the continued fraction decomposition of the number x.
  4502. :[font = input; preserveAspect; nowordwrap; ]
  4503. ContinuedFraction[x_Real, n_Integer] :=
  4504.  Floor[ NestList[ 
  4505.      Function[{u}, 1/(u - Floor[u])], x, n - 1] ] 
  4506. :[font = input; preserveAspect; startGroup; nowordwrap; ]
  4507. ContinuedFraction[.34252515, 7]
  4508.  
  4509. :[font = output; inactive; formatted; output; endGroup; endGroup; endGroup; nowordwrap; ]
  4510. {0, 2, 1, 11, 2, 2, 1}
  4511.  
  4512.  
  4513.  
  4514.  
  4515.  
  4516.  
  4517.  
  4518.  
  4519.  
  4520.  
  4521.  
  4522.  
  4523.  
  4524.  
  4525.  
  4526.  
  4527.  
  4528.  
  4529.  
  4530.  
  4531.  
  4532.  
  4533.  
  4534.  
  4535.  
  4536.  
  4537.  
  4538.  
  4539.  
  4540.  
  4541.  
  4542.  
  4543.  
  4544.  
  4545.  
  4546.  
  4547.  
  4548.  
  4549.  
  4550.  
  4551.  
  4552.  
  4553.  
  4554.  
  4555.  
  4556.  
  4557.  
  4558. ;[o]
  4559. {0, 2, 1, 11, 2, 2, 1}
  4560. :[font = section; inactive; preserveAspect; startGroup; nohscroll; ]
  4561. The Mathematica User Interface
  4562. :[font = text; inactive; preserveAspect; nohscroll; ]
  4563. Mathematica consists of two parts -- the "kernel", which actually does computations, and the "front end", which deals with interaction with the user.  The kernel of Mathematica is essentially the same on all computers that support Mathematica.  The front end, on the other hand, works differently on different kinds of computers. 
  4564.  
  4565. Mathematica for Windows has a sophisticated front end that takes advantage of the Windows graphical user interface.
  4566. :[font = text; inactive; preserveAspect; endGroup; endGroup; nohscroll; ]
  4567. One of the most important aspects of the Windows front end is its ability to support Mathematica notebooks.  
  4568.  
  4569. This file is an example of a notebook.  Notebooks consist of a mixture of text, graphics, and Mathematica input.
  4570.  
  4571. Notebooks can be used like "interactive textbooks" --  you read the text in the notebook, then use the Mathematica input in the notebook to perform calculations.
  4572. ^*)